Here's how to install Lighttpd on Raspberry Pi.
Publishing Static Web Pages
First things first. Update your package manager called Advanced Package Tool.
sudo apt-get update && sudo apt-get upgrade
Time to install a web server so that you can publish a static web page.
Install the Lighttpd web server.
sudo apt-get install lighttpd
Add the PI user to www-data group and set the permission flags of the /var/www directory. This is the default document root.
sudo adduser pi www-data
sudo chown -R www-data:www-data /var/www/
sudo chmod -R 775 /var/www/
Once you're logged in and you've completed setting up a few permissions, go ahead and create your first web page.
Publishing Dynamic Web Pages
PHP is a good choice for Raspberry Pi because it's easy to install and it doesn't consume a lot of resources.
Update apt-get package manager for Raspberry Pi
sudo apt-get update
sudo apt-get install php5-cgi
Install FastCGI module in the Lighttpd to speed things up