Today I noticed that AWStats, the web traffic analysis tool, had stopped generating valid reports since November 23. After spending about 3 whole hours trying to figure out what on earth had happened and having checked all the things that could have gone wrong, I went through all the automatic emails my server had sent me during the last 4 days and, finally, found out that a cronjob, which updates the GeoIP database on a weekly basis, instead of saving the actual database, it had saved the HTML error document, because the actual database could not be found at its normal location on the web. Maxmind, the company that publishes the database had just moved it to a new location without even bothering to create a symlink! AWStats on the other hand did not print any relevant error message. It just behaved strangely. As soon as I fixed the URL to GeoIP.dat.gz inside the cronjob and updated the files, all things came back to normal.
Update: Talking about URLs without actually writing them is a bit awkward, so here is the ugly script I use to update the free GeoIP databases from Maxmind:
#! /bin/sh LIMIT="100k" # Update GeoLite Country (GeoIP default) wget --limit-rate=$LIMIT http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz -O /usr/share/GeoIP/GeoIP.dat.gz rm -f /usr/share/GeoIP/GeoIP.dat gunzip /usr/share/GeoIP/GeoIP.dat.gz # Update GeoLite City wget --limit-rate=$LIMIT http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -O /usr/share/GeoIP/GeoLiteCity.dat.gz rm -f /usr/share/GeoIP/GeoLiteCity.dat gunzip /usr/share/GeoIP/GeoLiteCity.dat.gz
It shows the current URLs for the free or lite versions of GeoLite Country (GeoIP.dat) and GeoLiteCity databases. Currently, I have enabled the first one in AWStats.
Note to self. I should urgently add some checks prior to replacing the current databases. This goes in the TODO list.
Maxmind’s GeoIP.dat.gz location change by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2008 - Some Rights Reserved