I just posted this on another thread of someone who asked me but I think this would be interesting for many others here .. specially to those who is interested on optimize their adservers.
Quoted from GeoIP website:
QUOTE
Analyze your web logs to locate your clients, geo-target banner ads, detect credit card fraud, auto-select country on forms, prevent password sharing and abuse of service, and display native language and currency.
Obtain the Country, Region, City, Latitude, and Longitude of any IP address. We can customize MaxMind GeoIP to meet your needs.
Our APIs are Open Source and we offer a free database that is updated monthly.
Obtain the Country, Region, City, Latitude, and Longitude of any IP address. We can customize MaxMind GeoIP to meet your needs.
Our APIs are Open Source and we offer a free database that is updated monthly.
This will be specially useful to those who use the great (and best) open source free software for banner ads serving phpAdsNew (http://www.phpadsnew.com).
Ok .. here goes the How-to:
1. Get root privileges and move to an empty dir:
su -
mkdir /home/admin/geoip
cd /home/admin/geoip
2. Download and install library:
wget http://www.maxmind.com/download/geoip/api/.../c/GeoIP.tar.gz
tar xzfv GeoIP.tar.gz
cd GeoIP*
./configure
make
make check
make install
cd ..
3. Download and build Module:
mkdir mod_geoip
cd mod_geoip
wget http://www.maxmind.com/download/geoip/api/...ip_1.1.1.tar.gz
tar xzfv mod_geoip_1.1.1.tar.gz
cd mod_geoip_1.1.1
apxs -cia -I/usr/local/include -L/usr/local/lib -lGeoIP mod_geoip.c
4. Add /usr/local/lib as a loadable dynamic link:
edit /etc/ld.so.conf and add /usr/local/lib at the bottom so it looks like this:
/usr/kerberos/lib
/usr/lib/mysql
/usr/X11R6/lib
/usr/local/lib
Then execute /sbin/ldconfig /etc/ld.so.conf
5. Review httpd.conf . You should have seen a backup of the httpd.conf has been made when building the module as mod_geoip info has been inserted.
You'll find 2 lines inserted about mod_geoip.
First one:
LoadModule geoip_module lib/apache/mod_geoip.so
change to
LoadModule geoip_module /usr/lib/apache/mod_geoip.so
Add below that line:
GeoIPEnable On
the the second line is OK ... just move it to the AddModule section to keep httpd.conf pretty:)
AddModule mod_geoip.c
6. Go and restart Apache and you should not get any error.
service httpd restart
Then you can set the cron jobs to get updated databases (if you got a license) or just leave as is to keep using the free one included ( they say the free one is also updated monthly .. but will need manual download )