A couple years ago I maxmind database geo lookup database setup on your server. Since then they have released a new version of their database which is supposed to be better/faster etc but it seems a little trickier to get set up.
The new database file format (MMDB) requires a different way of setting up the database reader. The default option is to use a pure Python module which can read the MMDB binary files. However it is recommended to use the C extension which can dramatically increase lookup performance. This is especially important in high traffic situations.
To install this extension you need to have a working cURL installation. This is usually included in your web server / php installation but if not you can install it from the distribution website or using cURL commands.
Bot or Not: Strategies for Identifying and Handling Automated Traffic
Once you have the cURL library installed you can install the libmaxminddb C API and use it to set up the Maxmind database reader. The instructions distributed with the API should be followed to setup the database reader.
The maxmind database can be used to determine the location of an IP address at a city, country or continent level. It can also provide a wide range of additional information such as the name of the ISP or the organization that owns the network. The resulting information should not be considered accurate enough to identify an individual. This is because the database is not necessarily located at a single point in the world and because the data is often approximate.