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:
mkdir /usr/local/lighttpd/etc
mkdir /usr/local/lighttpd/logs
mkdir /usr/local/lighttpd/www
mkdir /usr/local/lighttpd/var
chgrp nogroup /usr/local/lighttpd/logs
chgrp nogroup /usr/local/lighttpd/var
chmod 775 /usr/local/lighttpd/logs
chmod 775 /usr/local/lighttpd/var
And finally, we'll create a very simple webpage to test things with:
echo "<p>hi</p>" > /usr/local/lighttpd/www/index.html
If you found this article helpful, consider making a donation to offset the costs of running this server, to one of these addresses: