After the make command has succesfully finished, you should find mod_geoip.so in the /usr/local/src/lighttpd-1.5.0/src/.libs directory. This is all we need so we don't need to run make install. We can continue to use our old lighttpd installation and simply copy mod_geoip.so to the directory which contains our lighttpd modules (e.g. /usr/lib/lighttpd):
Now we must configure lighttpd to use mod_geoip. First, we download the GeoIP country database:
mkdir /usr/local/data
cd /usr/local/data
wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
gunzip GeoIP.dat.gz
Then open /etc/lighttpd/lighttpd.conf and add "mod_geoip", to the server.modules section; also add the geoip.db-filename and geoip.memory-cache directives below the server.modules section:
To see if mod_geoip is working correctly, we can create a small PHP file in one of our web spaces (e.g. /var/www) (of course, PHP must be enabled in your lighttpd installation):
vi /var/www/geoiptest.php
<?php
print_r($_SERVER);
?>
Call that file in a browser, and it should display the SERVER array including values for GEOIP_COUNTRY_CODE, GEOIP_COUNTRY_CODE3, and GEOIP_COUNTRY_NAME(make sure that you're calling the file from a public IP address, not a local one).
If you want to use lighttpd + mod_geoip for your OpenX ad server, make sure you select MaxMind mod_apache GeoIP under Settings > Main Settings > Geotargeting Settings. This will work for lighttod + mod_geoip as well.
Please do not use the comment function to ask for help! If you need help, please use our forum. Comments will be published after administrator approval.
Sponsored Links:Unified Communications: Thoughts, Strategies and Predictions
Join the discussion. www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint. www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion www.seamlessenterprise.com
Recent comments
17 hours 26 min ago
18 hours 55 min ago
22 hours 29 min ago
1 day 1 hour ago
1 day 4 hours ago
1 day 5 hours ago
1 day 5 hours ago
1 day 6 hours ago
1 day 7 hours ago
1 day 7 hours ago