Installing mod_geoip For Lighttpd On Debian Etch - Page 2
2 Second Way - Building mod_geoip From The SourcesIf you've compiled lighttpd yourself, you should choose one of the following chapters. If you're using lighttpd 1.4.x, follow chapter 2.1, for lighttpd 1.5.x use chapter 2.2.
2.1 lighttpd 1.4.xFirst, install all prerequisites: apt-get install build-essential dpkg-dev fakeroot debhelper cdbs libssl-dev zlib1g-dev libbz2-dev libattr1-dev libpcre3-dev libmysqlclient15-dev libldap2-dev libfcgi-dev libgdbm-dev libmemcache-dev liblua5.1-0-dev dpatch patchutils pkg-config uuid-dev libsqlite3-dev libxml2-dev automake libtool libgeoip1 libgeoip-dev Then download the lighttpd sources that match your installed lighttpd, e.g. 1.4.13: cd /usr/local/src/ cd lighttpd-1.4.13/src Now open Makefile.am and after the last lib_LTLIBRARIES stanza (should be the lib_LTLIBRARIES += mod_accesslog.la stanza), add the following stanza: vi Makefile.am
It should look like this:
Next do this: cd .. ./configure --with-linux-aio --libdir=/usr/lib/lighttpd --sbindir=/usr/sbin --with-openssl --with-pcre --with-bz2 --with-ldap --with-mysql --with-memcache --with-lua=lua5.1 --with-gdbm --with-attr --with-webdav-locks --with-webdav-props After the make command has succesfully finished, you should find mod_geoip.so in the /usr/local/src/lighttpd-1.4.13/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): cp /usr/local/src/lighttpd-1.4.13/src/.libs/mod_geoip.so /usr/lib/lighttpd Now we must configure lighttpd to use mod_geoip. First, we download the GeoIP country database: mkdir /usr/local/data 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: vi /etc/lighttpd/lighttpd.conf
Restart lighttpd: /etc/init.d/lighttpd restart 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
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). Array 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.
|
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
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com






print: 
Recent comments
22 hours 15 min ago
23 hours 43 min ago
1 day 3 hours ago
1 day 6 hours ago
1 day 9 hours ago
1 day 9 hours ago
1 day 10 hours ago
1 day 11 hours ago
1 day 12 hours ago
1 day 12 hours ago