mod_geoip

Found a nice article on how to integrate mod_geoip in PHP.

http://blackonsole.blogspot.com/2009/02/install-and-configure-geoip-on-opensuse.html

wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gz

wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz

apxs2 -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.c


IfModule mod_geoip.c

GeoIPEnable On
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat

IfModule


$country_code = apache_note("GEOIP_COUNTRY_CODE");
print "Code : " . $country_code . "
";
$country_name = apache_note("GEOIP_COUNTRY_NAME");
print "Country: " . $country_name . "
";

Comments are closed.