Monday, 11 October 2010

Various stuff

I spent all morning and the first part of this afternoon doing website stuff. I was trying to install the latest version of nginx with the geo-ip module on the web server. But when I ran my shell script to do this, it had an error that it couldn't copy (backup) the old nginx installation. And then the new one didn't work!

So I was left without a working web server for probably 5 - 10 minutes while I tried to compile a working nginx (I couldn't just switch back to the previous one since the copy had failed, and the so the new version overwrote it). After some googling I found that I just needed to put set -e near the top of my shell script, which makes it exit when there is an error instead of continuing on with the next command.

The problem causing my new installation of nginx not to work was that it couldn't find the GeoIP library. I couldn't work out why I was getting the error, so I posted to the nginx forums / mailing list to try and get some help.

After that I tried to find why my awstats hadn't been updating for about a month. I found it was because it couldn't find the Geo-IP perl module. After some googling I found how to make the PERL5LIB environment variable (which I had added the location of the Geo-IP perl module to) persist, so that awstats could find the Geo-IP perl module okay. Now I just needed to update the awstats with all the log files it had missed while it wasn't working.

This post - Overriding the AWStats LogFile Configuration Option - came in very handy, and I used the shell example there except with two loops - one to loop through my site configs, and then an inner loop to loop through the dated log files for that site. Loads quicker than having to manually update awstats with the log files for each week per site separately.

For the rest of the afternoon I went on a walk and processed / sorted some photos.

In the evening I watched a Christmas episode of Power Rangers with L, and Batman Returns with L and Mauser.

No comments: