This tutorial is specific to Directadmin servers. Having said that, with minimal changes will work on most of the web servers. I'll try to provide generic installation instructions as much as possible.
Download latest geoip package:
Unzip the file and start compilation after installing some requirements (example on a Debian server)
apt-get install libgeoip-dev libgeoip1 geoip-database geoip-bin
tar xzvf geoip-1.0.7.tgz
Edit php.ini and insert the new module:
Search for extension_dir and be sure that the geoip.so is located there and then add the following line:
That's all! Restart Apache and open a page with the following to test it.