Attention Internet Explorer users: This site won't look like ass if you use a better browser. My site, my rules.

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

Comments

Dave Myron

Feb. 14th, 2006

6:50 p.m.

The .diff is no longer available. Do you have a copy?

Jacob

Feb. 14th, 2006

8:28 p.m.

It looks like lighttpd is now in Dapper, so you should use APT to install it from there: http://packages.ubuntu.com/dapper/web/lighttpd

Claus

March 1st, 2006

3:19 p.m.

The Dapper package uses some changes to /lib/lsb/init-functions that aren't in the Breezy repositories

Discussion and workarounds here:
http://www.ubuntuforums.org/showthread.php?t=108152

Backgrounder on lsb init-functions here:
http://lists.debian.org/debian-devel/2005/11/msg01309.html

Jacob

March 1st, 2006

4:15 p.m.

Claus -- thanks, that helps a lot.

Jeremy

Oct. 5th, 2006

12:29 p.m.

I ended up using the instructions located here:

http://trac.lighttpd.net/trac/wiki/TutorialInstallation

"Since lighttpd 1.4.8 the debian/ directory was removed to simplify the inclusion into Ubuntu and Debian. If you want to build your own debian package take the debian/ dir from a older release and update the debian/changelog and follow the steps below:"

Your 2¢

Comment