technology from back to front

Archive for December, 2006

Debian Etch on Dell Optiplex 320

After a number of false starts, we were about to give up on the Dell Optiplex 320 as a machine too weird to run Debian on. However, we persevered, and discovered the magic options that cause Debian Etch to not only install, but also boot.

  • Supply the kernel parameter pci=nomsi – this lets the installer (and, for that matter, the normal running kernel once you’ve finished installation) initialise the SATA disk controller correctly. If you omit this, you will see messages like “Unexpected IRQ trap at vector c0“, and the kernel will refuse to detect any hard disks.
  • Install LILO instead of GRUB. For some reason, GRUB refused to read the kernel from the disk after installation was complete. Happily, causing the installer to use LILO instead (on the MBR) results in a booting, kernel-loading, pci=nomsi-configured system.

I have seen the light

It’s been a while since I started hearing rumors about LigHTTPd, a new free software web server that is gaining popularity, especially within the dynamic community. For a long time I dismissed it, though. Why the duplication of effort? After all, the free software community already has a very successful web server product – Apache. The problem is that Apache, while being a very complete product, is quite difficult to run. I never felt like I really mastered its configuration, for example – I usually end up just copying examples from other users and adjusting them, hoping that I got it right (and worrying that I probably missed something).

Recently I had to configure a FastCGI application to work in a mixed SSL and plain HTTP environment. Turns out Apache makes it quite difficult – it wont ship SSL as part of the product, and finding out how to configure it turned out to be far from trivial. Also, Apache1, that beloved monolithic monster, does have pretty good support for FastCGI via a module, but Apache2 doesn’t really have any good solution.

A few hours into the adventure I remembered LigHTTPd (pronounced lighty, usually) and thought I might as well give it a try. A quick sudo apt-get install lighttpd later I have it up and running – SSL support is built in, and it only took me five minutes to self-sign a certificate and get it going. FastCGI was just as easy. The first thing I noticed is how quickly the server starts up – that might not sound like an important feature, but in a development environment, where I tend to restart the server regularly (anybody knows of a better way to force a FastCGI application to reload, b.t.w?) it’s very nice to have. There was also a noticeable improvement in the speed of serving disk-based resources (the improvement in performance, according to the benchmarks is indeed quite impressive). What really bought me, though, was the configuration – Lighty’s configuration style is so intuitive, and after just a few minutes of playing with it I had the feeling that I know how to do most of what I wanted – there’s a uniform syntax for setting parameters or adding items to lists of parameters, and statements can always be qualified with a rule (only for a certain domain, or port, or matching an expression on the query, you-name-it).

Here, for example, is what my configuration looks like (with some comments):

# HTTPS support for the entire subdomain
# (note that the rule could be anything at all)
$SERVER["socket"] == "myapp.mydomain:443" {
  ssl.engine = "enable"
  ssl.pemfile = "/path/host.pem" = "/path/host.cert"

# Configuration for my application's subdomain
$HTTP["host"] == "myapp.mydomain" {
  # Add an alias to the filesystem path of my app code
  alias.url += ( "/the-app/" => "/path/to/app/code/" )

  # Set-up the FastCGI server
  fastcgi.server = ( "/the-app/app-script.fcgi" =>
   (( "socket" => "/tmp/fastcgi.socket",
      "bin-path" => "/path/to/app/code/app-script.fcgi",
      "max-procs" => 1

  # Rewrite rules
  url.rewrite-once = (
    # Use Lighty to serve static resources - it's much faster that way!
    "^/(css|js|images)/(.*)$" => "/the-app/$1/$2",
   # Rewrite all other urls to be served by the application
   # So that I can construct pretty URLs
    "^/?(.*)$" => "/the-app/app-script.fcgi/$1"

If you’ve ever had to configure Apache, you’ll immediately notice how much nicer Lighty’s format is, and with performance being as good as it is, I think I will now default to using Lighty whenever I can. If you need a good web server, give Lighty a try, you wont be disappointed!

Tom Berger



You are currently browsing the LShift Ltd. blog archives for December, 2006.



2000-14 LShift Ltd, 1st Floor, Hoxton Point, 6 Rufus Street, London, N1 6PE, UK+44 (0)20 7729 7060   Contact us