Installing mod_geoip For Apache2 On Fedora 9
Installing mod_geoip For Apache2 On Fedora 9Version 1.0 This guide explains how to set up mod_geoip with Apache2 on a Fedora 9 system. mod_geoip looks up the IP address of the client end user. This allows you to redirect or block users based on their country. You can also use this technology for your OpenX (formerly known as OpenAds or phpAdsNew) ad server to allow geo targeting. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm assuming that you have a running Fedora 9 system with a working Apache2 + PHP, e.g. as shown in this tutorial: The Perfect Server - Fedora 9.
2 Installing mod_geoipTo install mod_geoip, we simply run: yum install mod_geoip You will then find the GeoIP database (GeoIP.dat) in the /usr/share/GeoIP directory. As the geographic allocation of IP addresses can change over time, it's a good idea to download the newest GeoIP.dat now: cd /usr/share/GeoIP/ Next we restart Apache: /etc/init.d/httpd restart That's it already!
3 A Short TestTo see if mod_geoip is working correctly, we can create a small PHP file in one of our web spaces (e.g. /var/www/html): vi /var/www/html/geoiptest.php
Call that file in a browser, and it should display the SERVER array including values for GEOIP_COUNTRY_CODE, GEOIP_CONTINENT_CODE, and GEOIP_COUNTRY_NAME (make sure that you're calling the file from a public IP address, not a local one). Array If you want to use Apache2 + mod_geoip for your OpenX ad server, make sure you select MaxMind mod_apache GeoIP under Settings > Main Settings > Geotargeting Settings:
4 Use CasesYou can use mod_geoip to redirect or block/allow users based on their country. You can find some useful examples for this here: http://www.maxmind.com/app/mod_geoip
5 Links
|







Recent comments
10 hours 24 min ago
10 hours 31 min ago
12 hours 9 min ago
13 hours 43 min ago
17 hours 17 min ago
19 hours 37 min ago
19 hours 38 min ago
21 hours 25 min ago
21 hours 34 min ago
1 day 1 hour ago