Installing GeoIP Mod on Apache

I followed these steps:


mkdir /usr/share/GeoIP
cd /usr/share/GeoIP

wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip -d GeoIP.dat.gz


wget https://documentation.cpanel.net/download/attachments/2326651/custom_opt_mod-mod_geoip.tar.gz
tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf custom_opt_mod-mod_geoip.tar.gz

WHM -> Software -> EasyApache (Apache Update) -> Start customizing based on profile -> Check 'Mod GeoIP' option (on Short / Exhaustive Options List page) -> Save and Build


LoadModule geoip_module /usr/local/apache/modules/mod_geoip.so
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat MemoryCache


So, what does this allow me to do?

Well, usage info is here: http://dev.maxmind.com/geoip/legacy/mod_geoip2/

And it will basically let me Geo target things and make better redirect rules or ban Countries or restrict them and stuff. It was a fun install and it actually works, I think it does, haven't tested it yet.


Comments

  • SlartibartfastSlartibartfast Global Moderator -__-
    That's a pretty interesting module. I know a lot of people do geo-stuff straight from the DNS but this has advantages as it's not limited to load balancing stuff.

  • DfgDfg Admin

    That's a pretty interesting module. I know a lot of people do geo-stuff straight from the DNS but this has advantages as it's not limited to load balancing stuff.

    I used Maxmind API before to get the details, it was fast but it did cost us money, this solution is free :)
Sign In or Register to comment.