Jacob Kaplan-Moss

Lightpd on Ubuntu

I wrote this post in 2005, more than 16 years ago. It may be very out of date, partially or totally incorrect. I may even no longer agree with this, or might approach things differently if I wrote this post today. I rarely edit posts after writing them, but if I have there'll be a note at the bottom about what I changed and why. If something in this post is actively harmful or dangerous please get in touch and I'll fix it.

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