This works for Ubuntu, Debian and CentOS distributions. You need a valid license key from MaxMind. This is available as a subscription at a nominal fee.
If you have installed GeoIP successfully, you should have the geoipupdate program. If you don’t, you need the run the following.
Install over Ubuntu or Debian:
sudo apt-get install geoip-bin geoip-database libgeoip-dev
Install over CentOS:
sudo yum install re2c geoip geoip-data geoip-devel
Both libgeoip-dev and geoip-devel are required for compiling PHP’s GeoIP.
Once you run geoipupdate the first time, it tells you about a missing GeoIP file.
root@gladlycode:~# geoipupdate Error opening GeoIP Configuration file /etc/GeoIP.conf
Now you copy over from the default file:
mv /etc/GeoIP.conf.default /etc/GeoIP.conf
If you now run geoipupdate, you get the following:
MD5 Digest of installed database is f5c2f7eed9331dcaa99b7a6b4633b684
Invalid UserID