
Installing Lighttpd
Lighttpd has very little dependencies considering the wealth of functionalities it provides. For most systems, getting Lighttpd is just a matter of downloading and installing a package. Before we go out and get one, we better know what we want. There are two branches of Lighttpd: a stable branch and a development branch.
The stable branch is very solid and changes at the most once every two months (if bug fixes are not counted, then about once a year), allowing the developers to concentrate on bug fixes. The development branch moves faster, with a new release every four to six weeks. The development snapshots contain new shiny features, but can also contain hidden bugs, break old features and can generally be less stable.
At the time of writing, version 1.4.19 is deemed to be the stable version, while pre-releases of the upcoming 1.5.0 version are distributed for more testing before the final release. Some systems might have packages of older versions, but anything older than the stable branch many contain known security holes.
For a live server, or if we want the latest versions, we usually compile Lighttpd from sources. For a development server, we might take the easy route and install a precompiled package to leave the worries about dependencies to whoever maintains the package database.
The last question is, on which system we should use Lighttpd? My pragmatic advice is to use what you have. For a development system, take the platform you currently work on. For integration and production platforms, this advice needs to be constrained a little—apart from Windows, which allows too little connections to be open in parallel, most operating systems are suitable for production use—the POSIX-implementing ones (Linux, every BSD, Solaris, Mac OS X, and so on) also benefit from numerous optimizations.
Now, without further ado, here is a list of binary packages per system:

To compile Lighttpd from source, download the latest source package from http://lighttpd.net/download/
. Between Lighttpd versions 1.4.19 and 1.5.0, the build system has changed from Autotools to CMake. Before we can install it, we need the following:
- A compiler and toolchain—most systems have gcc make and a libc (usually glibc) providing the usual functions. For some embedded platforms, the need to define some constants by hand before cross-compiling has been observed.
- PCRE—the libpcre package (http://www.pcre.org) supplies PERL-compatible regular expressions to Lighttpd. Lighttpd will run without it, but won't do anything more complex than serving web pages directly under only one hostname and path, without any rewriting or redirecting.
Apart from these, there are some optional packages that expand the capabilities of Lighttpd:
- OpenSSL (http://openssl.org) or any other SSL library (but OpenSSL is the most-tested one) is needed for transport layer encryption, so our site can be accessed via https.
- zlib (http://www.zlib.org) is required for
mod_compress
to supply on-the-fly gzip compression for static content. As virtually every system has zlib available, this should not concern us. - bzip2 (http://www.bzip.org) can also be used by
mod_compress
static content for clients who allow bzip2 compression. It is a little slower than zlib, but achieves higher compression rates. - Lua (http://www.lua.org) is a small, fast, powerful scripting language, which is a perfect match for Lighttpd and can be embedded as
mod_magnet
. - MySQL (http://www.mysql.org) is a product by the company that employs the author of Lighttpd. Therefore, it is no surprise that Lighttpd uses MySQL for database-backed virtual hosting. Also, under Debian, a binary install depends on MySQL.
- pkg-config (http://pkgconfig.freedesktop.org) is not strictly necessary, but it will make the installation easier. Especially for Lua, the Lighttpd installation process relies on it unless given explicit library paths.