Jacob Kaplan-Moss

Lightpd on Ubuntu

Ubuntu “Breezy” doesn’t have lighttpd (yet), and the only Ubuntu binaries I could find were (a) stale and (b) compiled for x86. Building lighty from source with the standard configure; make; make install dance works fine, but it forgoes APT… and why would you use Ubuntu if you wanted to avoid APT?

So, here’s how to build lighty from source into a Ubuntu package so it’s all nicely wrapped up and maintained for you. The bonus is that this will also give you the Ubuntu-specific /etc/init.d file and a few other Debian-isms.

First, make sure you have “universe” in your /etc/apt/sources.list (uncomment the “universe” lines if they are commented out).

Next, install some prerequisites:

$ aptitude install libpcre3-dev zlib1g-dev dpkg-dev \
                   debhelper cdbs libssl-dev \
                   libbz2-dev libldap2-dev \
                   libfcgi-dev dpatch patchutils \
                   libmysqlclient14-dev libfcgi-dev

Then download the lighty sources along with the diff needed for Ubuntu:

$ wget http://lighttpd.net/download/lighttpd-1.4.8.tar.gz
$ wget http://diotavelli.net/files/deb/source/lighttpd_1.4.8-1.diff.gz
$ tar xzf lighttpd-1.4.8.tar.gz
$ gunzip lighttpd_1.4.8-1.diff.gz
$ patch -p0 < lighttpd_1.4.8-1.diff

Next, build the package:

$ cd lighttpd-1.4.8
$ chmod +r debian/rules
$ dpkg-buildpackage -d

Finally install the .deb you’ve just created:

$ cd ..
$ dpkg -i lighttpd_1.4.8-1_amd64.deb