The WebInterface created at UniMe for the IoTronic project is based on a framework called CodeIgniter http://www.codeigniter.com/ (we used version 3.1.2).
Requirements (satisfied during the guide)
- Server Web (apache2)
- Some Linux libraries
- php5 / php7
- A CodeIgniter library
- A responsive front-end framework (foundation-5.5.3 --> http://foundation.zurb.com/downloads/foundation-5.5.3.zip).
Automatic installation and configuration
Before launching the script
install_dash.sh set the
flag_ssl variable in order to have SSL enabled or not.
Manual installation and configuration
If the automatic installation above didn't complete correctly you can do the same steps manually following these steps.
- Install some libraries:
apt-get install php5 libapache2-mod-php5 php5-curl(or
apt-get install php7.0 libapache2-mod-php php7.0-curlin recent releases)
- Enable the rewrite Apache module:
- Append the following lines in the Apache config file:
<Directory "/var/www/html"> AllowOverride All </Directory>
- Restart Apache service:
service apache2 restart
- Verify Apache needed modules:
apache2ctl -M(verify the presence of the following lines:
- Modify "short_open_tag" option from "Off" to "On":
vim /etc/php/7.0/apache2/php.iniin recent releases)
OPTIONAL (SSL for https connection)
a2enmod ssl && a2ensite default-ssl
SSLCertificateKeyFilein the following Apache conf file:
/etc/apache2/sites-available/default-ssl.confadding the corresponding paths
service apache2 restart
- Verify if the module
ssl_module (shared)is loaded.
Download the CodeIgniter-3.1.2 from https://github.com/bcit-ci/CodeIgniter/archive/3.1.2.zip into the
/var/www/html folder on the server and unzip it. Rename the folder to one of your choice (e.g.: iotronic in our case), substitute the
application/config/config.php configuration file with the one on this repo and make the correct changes to parameters as suggested according to the server-side iotronic environment you already set.
CodeIgniter extra packages
To use the API developed it is necessary to download the CodeIgniter Curl library (not present by default) into the
As front-end framework we used the previously mentioned Foundation which has to be downloaded into
assets folder as follows:
mkdir -p bower_components/foundation && cd bower_components/foundation
wget http://foundation.zurb.com/cdn/releases/foundation-5.5.3.zip && unzip foundation-5.5.3.zip
Last steps before browsing the interface
- Copy the content of the folders in this repo inside your folder (e.g.: iotronic in our case) paying attention to follow the same folders tree
- Copy the
.htaccesswhich contains the rewrite rules and the images linked inside the code
Final steps (both automatic and manual procedures)
In both automatic and manual installation you need to modify the parameters in brackets inside the following file
application/config/config.php and then display the WebPage on this URL:
If you come across forbidden access errors launch
chmod 755 -R <folder> command on templates and uploads folders.