Lighttpd & Wordpress

I’ve finally got lighttpd (or lighty as it is more commonly known) going! It’s taken a while but I’ve finally managed to to it. The machine that this blog and Limes and Lycopene runs on is what is known as a virtual machine and the funky bit of software that makes all this happen is called Xen which was developed at Cambridge University.The machine is hosted by a local company called Solutions First who provide an excellent service. The only downside to this is that the amount of memory is quite low but given the amount I pay for it this is by no means a complaint. I really do mean it when I say that it’s not a complaint as it has made me tune the box so that it is not a complete dog. Hence my conversion to lighty —- I might write a post about my fun and games with the spammers and getting my MTA (postfix) tuned so that it doesn’t kill the box but I will leave that for another day.
The blogging software used by this blog is the fairly well know Wordpress which was running under apache, using mysql. I’ve tuned mysql to not use much memory but apache really does use a lot so when a contractor at work suggested that I use lighty I gave it a go. Only it wasn’t very satisfactory, it keep dumping core (which I think was more to do with php that lighty itself) and I couldn’t get it to do anything else so I put it on the back burner. So after recently updating my trusty vm to Ubuntu Dapper Drake I thought I would give it a go. And lo and behold there was much rejoicing for now you are reading this on web pages that are being served up by the mighty lighty! The only problem I had was getting the url rewriting going. The various web pages taking about lighty and Wordpress suggest the following:

server.error-handler-404 = "/index.php?error=404"

This worked fine on Two Second Memory but not on Limes and Lycopene until I realised that Limes and Lycopene has /blog in the path whereas mine doesn’t. D’oh! So after a quick edit of lighttpd.conf the results looks like:

server.error-handler-404 = "/blog/index.php?error=404"

The results really are quite dramatic. The site is much more responsive and the memory consumption is about half. It just goes to show that a little effort, patience and belief in Open Source Software and good things really do happen. So a big thank you to the lighty developers.