Install GeoIP on CPanel CentOS server

       

December 29, 2009 Server Administration

Tech tipsComputer Tricks

nstall GeoIP binaries:

yum install GeoIP GeoIP-devel

Download more databases from MaxMind and put them into /opt/geoip/share/GeoIP/:

http://geolite.maxmind.com/download/geoip/database/

Install CPanel EasyApache GeoIP module:

wget http://twiki.cpanel.net/twiki/pub/EasyApache3/CustomMods/custom_opt_mod-mod_geoip.tar.gz

tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf custom_opt_mod-mod_geoip.tar.gz

  • Run EasyApache and select mod GeoIP:

/scripts/easyapache

Configure GeoIP by adding to httpd.conf (or pre_virtualhost_global.conf):

  • /usr/local/apache/conf/httpd.conf
  • /usr/local/apache/conf/includes/pre_virtualhost_global.conf

GeoIPEnable On
GeoIPDBFile "/opt/geoip/share/GeoIP/GeoIP.dat"

Install GeoIP PHP Extension:

  • Make sure that /tmp is mounted with exec option:

mount -o,remount,rw,exec /tmp

  • Install geoip via PECL:

pecl install geoip

Restart Apache:

/scripts/restartsrv_apache

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • blogmarks
  • Fark
  • LinkedIn
  • MSN Reporter
  • MySpace
  • Reddit
  • Socialogs
  • StumbleUpon
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz

Tags:

Leave a Reply