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.