Welcome to lighttpd

After a long afternoon I’ve got lighttpd to work with my current apache based layout.

This means I can choose whether to run apache or lighttpd.

Lighttpd is a webserver, like apache. The key advantage of lighttpd over apache is that lighttpd is very light on your server. It uses a lot less memory, which is very nice espacially when considering that my server only has got ~90mB of memory.

The drawback of lighttpd is that it is light and doesn’t support as much as apache does.

It doesn’t do .htaccess files. Everything needs to be configured in the lighttpd.conf, which doesn’t support everything, or at least not in the same way as apache does.

However, lighttpd is pretty easy to configure when you get the hang of it.

One particulair pain in the ass is getting old mod_rewrite using .htaccess to work, for instance the one used by wordpress of this blog.

I’ve added this in my lighttpd.conf:

$HTTP["host"] =~ "blog.w-nz.com" {
url.rewrite = ( "^/(page|archives|comments|search|feed)/" => "/index.php?error=404" )
}

One interesting thing to note is that the configuration file is nothing more than a script being executed for each request.

Leave a Reply

Your email address will not be published. Required fields are marked *