Maxmind’s GeoIP.dat.gz location change
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.
Related Articles
- How to change the Timezone
- Use wget or curl to download from RapidShare Premium
- A mass downloader…
- A quick AWstats guide
- When it comes to error messages…
Tags: Administration, Servers

November 27th, 2008 at 1:00 pm
It would be appreciated if you could give your readers the correct URL to the new GeoIP.dat.gz! ;-)
November 27th, 2008 at 1:48 pm
i think this is the new one:
http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/
November 27th, 2008 at 4:52 pm
@BOK: You are right. I added the script, which shows the URLs
@joost: Exactly
Thanks for the feedback