Geoip

From INIwiki
Jump to: navigation, search

NOTE: FOR SOME REASON THIS WILL PRODUCE ERRORS IN FIREFOX 3 BUT WORKS IN IE 7 -- YOU HAVE BEEN WARNED

Install GEOIP with Awstats

Contents

Install

yum install geoip

Test

geoiplookup google.com

Should return

GeoIP Country Edition: US, United States

Additional Databases

http://www.maxmind.com/download/geoip/database/

Attache to Awstats

Edit the awstats Config File

vi /etc/awstats/awstats.yourdomain.conf

add this line

LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"

and if needed this one:

LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoLiteCity.dat"
  • Note: you may need to modify the GeoIP.dat location.

Restart Apache

service httpd restart

Troubleshooting

if you get this error

Can't locate Geo/IP.pm

Install PurePerl with CPAN

cpan
install Geo::IP::PurePerl
bye

Restart Apache

/sbin/service httpd restart

Reference:

http://wiki.chrisdevbox.com/index.php/Setting_up_GeoIP_by_MaxMind (Didn't use this site but it might help fix the firefox issues)
Personal tools