Install mod_geoip: How to ?

1. mkdir /home/uruser/geoip
cd /home/uruser/geoip

2. Download and install library:


tar xzfv GeoIP.tar.gz

cd GeoIP*

make check
make install

cd ..

3. Download and build Module:

mkdir mod_geoip
cd mod_geoip




tar xzfv mod_geoip_1.1.1.tar.gz

cd mod_geoip_1.1.1

/usr/local/apache/bin/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/ and add /usr/local/lib at the bottom so it looks like this:


Then execute /sbin/ldconfig /etc/

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/

change to

LoadModule geoip_module /usr/lib/apache/

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.


Subscribe Now to stay updated.

Please fill in your email address to get most latest updates.