Getting the web server running:

The Raspberry Pi Web server install

To install the webServer on our master Raspberry Pi, we will install lighttpd

sudo apt-get -y install lighttpd

sudo apt-get -y install php5-common php5-cgi php5

Then enable the Fastcgi module which will handle the PHP pages :

sudo lighty-enable-mod fastcgi-php

Have to change /ect/lighttpd/lighttpd.conf

Working file looks like this. Changes were mainly to adding server modules and at the end.

Once these packages are installed we can restart the Lighttpd service to pick up the changes :

sudo service lighttpd force-reload

Test the web services by seeing if the default index page is there. Load up info.php as a test of the php libraries. The file is trivial, but it will give you a good deal of information on the PHP server, and show the web server is running and ready for your pages.

Set up the /var/www directories and make them readable (avoiding 403 or 404 errors if they are not already.)

I also went through and executed

sudo chmod 755 /var/www

So the web site directories were readable by everyone. User Pi is the owner, so I ftp in as pi.

Now need to load Python

Sudo apt-get -y update (good time to update all packages)

Sudo apt-get -y install python-rpi.gpio

This installs the GPIO packages and allows you to write python programs that control the pins.

The Web server process must be allowed to run as root for the GPIO python scripts to run. To allow this you need to:

as root, enter

echo "www-data ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers

This gives the webserver process the ability to run a python script as root. In the command above www-data is the name of the web server process id, if you have apache, you may need to change this to apache (or whatever id the webserver runs under)