Sunday, November 18, 2012

How to install a web server on Raspberry Pi - Lighttpd ( is an open source webserver which has reputation of being very light. Therefore it looks perfect for an Raspberry Pi. Here are the commands I used to install it

Lighttpd installation
sudo apt-get install lighttpd

The directory containing the web pages is:

The "pi" user does not have write permission to this directory.
You can give these rights with the following set of commands:

sudo chown www-data:www-data /var/www (to make the www-data owner of the directory)

sudo chmod 777 /var/www (to have full right to this directory)
sudo usermod -a -G www-data pi (to had the pi user to the www-data group)

You can now had your html file to the "/var/www" directory.

The configuration file is:

The error log is:

The command to restart the server:
sudo /etc/init.d/lighttpd restart

The command to reload the configuration
sudo service lighttpd force-reload

The server is ready. It is possible to use PHP and other services with Lighttpd, but I didn't do it so I can't explain it here.

No comments:

Post a Comment