Linoleum

Wednesday, April 11. 2007

While a large proportion of the world's webservers are currently using Apache, a competitor has been steadily gaining popularity on many high-usage sites. Lighttpd, pronounced "lighty", is a small-footprint, high-speed webserver, and is notably used by sites such as Sourceforge, YouTube and MiniNova. Netcraft state that Lighttpd is currently being used on 1.38 million sites, and is steadily gaining on Sun's share of the market. This introductory article provides a guide to getting Lighttpd installed and configured.

Compiling a basic server

Lighttpd's build process is quite straightforward, and anyone who has any experience with building applications under Unix before will be quite familiar with the process.

We'll start by unpacking the source code, and configuring it to install under /usr/local/lighttpd, using the --prefix option. There's no hard and fast need for it to be installed in that location, I've just chosen it so that everything is installed under a single directory, where it won't mess up the rest of the filesystem, and everything can be removed easily if need be.

tar xzf lighttpd-1.4.13.tar.gz
cd lighttpd-1.4.13

./configure --prefix=/usr/local/lighttpd
make
su
make install

We'll now create a few extra support directories, as root, to hold
configuration files, logs and our webpages: