Call us: 1-866-325-7983 Client Login

Client Area

  • Home
  • /
  • Clients
  • /
  • Client Area


Installation of Mod_GeoIP on cPanel server

Mod_GeoIP installation is easy. But  in a cPanel server you need to follow some procedure for installing  it.

 Your cPanel server  must have apache version 2.2.x  installed.

Now proceed with the following steps to install it.

 1) Download and install GeoIP database
# cd /usr/local/src/
# wget -c
# tar -xzf GeoIP-1.4.6.tar.gz
# cd GeoIP-1.4.6/
# ./configure
# make
# make install

2) Give apache user to read  permission to that datbase file

# chown nobody.nobody  /usr/local/share/GeoIP/GeoIP.dat
# echo '/usr/local/lib ' >  /etc/
# ldconfig

3) Download and install  mod_geoip

# cd /usr/local/src/
# wget -c
# tar -xzf  mod_geoip2_1.2.5.tar.gz
# cd mod_geoip2_1.2.5/
# /usr/local/apache/bin/apxs -lGeoIP  -cia mod_geoip.c

4) Create a file called  /usr/local/apache/conf/geoip.conf and add the following content

# cat >> /usr/local/apache/conf/geoip.conf << EOF
LoadModule geoip_module       modules/
<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat MemoryCache

5) Add this file to apache included custom file list

echo 'Include "/usr/local/apache/conf/geoip.conf" ' >>  /usr/local/apache/conf/includes/pre_main_global.conf

6) Rebuild httpd.conf and restart apache.

# /scripts/rebuildhttpdconf
# /scripts/restartsrv  httpd

Was this answer helpful?

Also Read

Powered by WHMCompleteSolution