Tag Archives: lighttpd

Sometimes it’s the simple things

Have you ever wrestled with a problem for far too long, before realizing that the solution was actually really simple?  I love to point and laugh when this happens to other people, but yesterday it happened to me.

A long time ago (on a server far, far away), I installed Lighttpd, and set up a very simple site.  The config file was only a few lines long – it pointed at the index page, and had the required mime-types for PHP and HTML.  For what I wanted at the time, that was fine.

I left the server for a long time, and completely forgot about how it was set up.

I decided to change the page that was on the server to a more useful wiki.  I installed MediaWiki, and everything looked OK until the installer completed, and I was greeted with an un-styled front page.

My first thought was that the paths were wrong.  I checked to make sure that there were no .htaccess rules that would affect how the page looked.  Lighttpd stores URL rewriting rules in config files (lighttpd.conf, or a mysite.conf file for each site), rather than in .htaccess, so checking that you’ve converted all the rules over to Lighttpd’s syntax is a good first step.

As far as I could see, everything was correct.  So, to me, the next obvious issue was folder permissions.  Everything in the /www folder should, in theory be owned by the wwwdata group and www user.  However, in this case I had used wget to download MediaWiki while logged in as an unrelated user, and I had chgrp / chown-ed the folders afterwards.  I thought that I may have made a mistake with the file permissions.

That turned out not to be the case.  After that, my troubleshooting skills failed me.  I tried re-installing Media Wiki, I even re-set up the site in Lighttpd – basically anything but checking that one darn config file.

Of course, after wasting far too much time on the problem, I went back to basics, and guess what – adding the mime information for .css files fixed the problem.  Yes, you can point and laugh now!

So, the moral of today’s story is – sometimes the most obvious things are worth looking at.

Advertisements

VPS Optimization for High Traffic Sites

I have a VPS with 384MB RAM available as standard, and the option to burst up to 1GB.

This is enough to run some fairly high traffic sites if you’re careful with the setup, but with the default setups and fancy control panels, you’ll exceed the memory limit quite quickly.

I use Citadel as the email client, but I’ve disabled Webcit.  I also removed Spam Assassin, and just use the Realtime Blackhole List to prevent spam.  Those simple changes have shaved over 100MB off my normal usage, but there’s still a lot to go.

top shows that memory usage is leaking up into the burst limit over time – even with some basic optimizations of httpd.conf and MySQL.  I’m considering trying lighttpd instead of Apache2 – I really don’t NEED Apache2, and it seems to be quiet a hog.

The other possible optimization would be to use something lightweight in place of named – which is currently sat at 180m memory usage!

If anyone has any favourite lightweight alternatives to named, I’d love to hear about them.