Skip to content

Web Server TCPLightingWebInterface Only

root edited this page Sep 13, 2019 · 1 revision

If you enabled SSH in the optional section you can now configure your Raspberry Pi remotely, using an SSH client: Putty is a commonly used client for windows. MacOS and Linux have built-in clients

Install Apache and PHP

The instructions below assume a basic knowledge of the vi text editor. It's use can be substituted by the editor of your choice

Apache

sudo apt-get install apache2 apache2-utils

Edit apache.conf to enable .htaccess and remove excessively informative server headers

sudo vi /etc/apache2/apache2.conf

To enable .htaccess to perform some IP based lockdown functions, find the entries below:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

change AllowOverride None to AllowOverride All The finished entry should now look like:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

To turn off the excessive header info, add the lines below to the end of the file.

ServerSignature Off
ServerTokens Prod

Change Permissions on the html directory so the pi user ID has read/write/execute permissions and the Apache server has read/execute.

sudo chmod 755 -R /var/www/html
sudo chown -R pi:www-data /var/www
sudo chmod u+rxw,g+rx-w,o-rwx /var/www

PHP

sudo apt-get install php libapache2-mod-php php7.0-curl php-xml php-pear php7.0-mysql php7.0-cgi

Restart Apache to recognize the PHP installation:

sudo /etc/init.d/apache2 restart

Installation Complete

You should now have a fully functioning webserver capable of running the TCPLightingWebInterface

The project files should be placed in /var/www/html

You are now ready to move on to Dynamic DNS Setup