In the world of open source web servers, you mostly talk about Apache, but the problem with Apache is that for development, it’s quite heavy and slower than other alternatives, such as Lighttpd. Even if in Lighttpd there is the word light, it doesn’t mean that it comes with fewer features. In fact, it’s far from the truth as light only stands for the small memory footprint and speed for static page serving.

Here is a list of some features available with Lighttpd :

Virtual hosts
Virtual directory listings
URL-Rewriting, HTTP-Redirects
Large File Support (64bit fileoffsets)
on-the-fly output-compression with transparent caching
deflate, gzip, bzip2
authentication : basic, digest
backends: plain files, htpasswd, htdigest, ldap
fast and secure application controlled downloads
Server Side Includes
User Tracking
FastCGI, CGI, SSI
Same speed as or faster than apache + mod_php4
Includes a utility to spawn FastCGI processes (neccesary for PHP 4.3.x) via FastCGI and CGI interface
load-balanced FastCGI (one webserver distibutes request to multiple PHP-servers via FastCGI)
chroot(), set UID, set GID
protecting docroot
strict HTTP-header parsing

Pure happiness for sysadmins and web developers. Lots of websites are already using it in a way or another, like YouTube, Wikipedia or even sourceforge.net.

Enough with the talk, let’s move to the installation, I’ll talk of the installation under Ubuntu, which is one of the most popular GNU/Linux distribution, and also the one that I personally use.

The first step is to install the packages using the apt-get command :

sudo apt-get install lighttpd lighttpd-doc libpcre3

Here you are, with your brand new Lighttpd installed. If with that installation you need to use mysql and php, you have to install these packages : mysql-common, libmysqlclient12, php5-cgi and even mysql-server if you need to host the database on the same server

In case you want to use php5, you need to activate the fastCGI module by issuing the following commands in a terminal:

sudo ln -s /etc/lighttpd/conf-available/10-fastcgi.conf /etc/lighttpd/conf-enabled/10-fastcgi.conf

sudo /etc/init.d/lighttpd restart

Here you go, you have your lighttpd installed with php5 alongside.

Now, all you have remaining to do is to change your settings according to your needs. To do so, my advice would be to browse the official documentation here. Or even better, ask me in the comments here and I’ll try to answer as soon as possible.