lighttpd 1.4 is out

light_logo.png Since weigon silently slipped lighttpd 1.4.0 out of the door last week (despite it still having 20 open tickets in its milestone cough) it only saw the light of the day of a few dozen servers when a few more or less critical bugs were found and squashed to release 1.4.1 this fine Monday.

So, what does 1.4 get us?

The NEWS entry for 1.4.0 is just 6 lines long. Among them are three word statements such as “added nested conditionals”. Hey, that’s major! Lets repeat that in bold. ”added nested conditionals”. Much better.

Nested conditionals provide you with a way to evaluate multiple conditions in a, well, nested manner. You can use regexes to provide special treatment for a certain hostname/url combination for example. This might solve some of the trac migration issues I talked about in the previous post, although I haven’t really played with the nested syntax just yet. See weigon’s announcement for additional examples.

Additionally, 1.4.0 (and the now available 1.4.1) ship with a complete Class 1 WebDAV client, a stat-cache based on FAM/Gamin as well as assorted fixes to mod_proxy and mod_fastcgi.

Something weigon completely missed out on shouting out loud in his release announcement is the fully backwards compatible configuration file format although certainly some directives changed from 1.3.x. I didn’t have to touch a single line in my 247 lines long lighttpd.conf (not counting comments). The manual would be the best place to start looking for updated directives.

Downloads in various binary forms as well as raw source code (compiling charmingly as a Debian package through the included buildpackage scripts) are available from lighttpd.net.

Update: Here we go, first nested conditional in my configuration to redirect my Typo blog’s article feeds to Feedburner without affecting the Feedburner crawler itself:


$HTTP["host"] =~ "^(www.)?(poocs.(org|com|net)|lenz.(vg|sh|cd))" {
    $HTTP["useragent"] !~ "FeedBurner" {
        url.redirect = (
            "^/xml/(rss|atom)" => "http://feeds.feedburner.com/poocsnet"
        )   
    }
}   

Update #2: With help from this blog post from Nicholas Riley I was able to finally migrate my Trac installation over to lighttpd as well. His config snippets provide a way to use a single FastCGI instance (and only a handful configuration directives) to serve multiple projects via the little to not-at-all documented environment variable TRAC_ENV_PARENT_DIR.

Please note, however, that both Trac’s FastCGI support as well as support for the aforementioned environment variable are not present in the 0.8.x series and require you to run from trunk (which hasn’t given me any major grief thus far though). You need to be running at least revision 2015.

On a related note, lighttpd 1.4 now supports an equivalent of Apache’s require valid-user authentication option via the ”require” => “valid-user” option of the auth.require directive which means you no longer have to specify each and every user in your configuration file. An example, as usual, is available from the lighttpd manual.

Filed Under: Software