GeoIP enables you to identify the location, organization, connection speed, and user type of your website visitors.

yum install GeoIP mod_geoip
cd /usr/share/GeoIP/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoLiteCity.dat.gz
rm -f *.gz

Edit the VirtualHost settings in httpd.conf

<ifmodule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat Standard
GeoIPDBFile /usr/share/GeoIP/GeoLiteCity.dat Standard
</ifmodule>

Restart Apache

/etc/init.d/httpd restart

Leo Gaggl

ict business owner specialising in mobile learning systems. interests: sustainability, internet of things, ict for development, open innovation, agriculture

This Post Has 3 Comments

  1. allan

    Hi Sir, Good afternoon from Philippines. Im done exactly what your blog said and restarted httpd. Quick question, how to know the out put of this? Ive tried to check my site and search for links there and i found none of geoip lookups. Ive check the logs of httpd looks fine. How to know that geoip lookups is doing some lookup? Thanks

  2. Leo Gaggl

    You need to have some PHP code that actually does GeoIP lookups. Some content management systems or Log-analysers have this included. Installing the packages alone does not do any lookups

  3. allan

    Oh ok. Would you mind to give an example, please?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.