Welcome to UltratechHost Forum, Guest. Please take the time to register if you haven't, or click

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
how to install geoip and mod geoip2 on centos for apache

How to install GeoIP and mod_geoip2 on centos for apache
#1
How to install GeoIP and mod_geoip2 on centos for apache

Code:
1) yum install GeoIP GeoIP-devel GeoIP-data zlib-devel

Code:
2) mkdir /usr/local/share/GeoIP

3) Download the latest Country and City database files from maxmind

Code:
cd /usr/local/share/GeoIP
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoIP.dat.gz
gunzip GeoLiteCity.dat.gz

Code:
4) yum install httpd-devel apr-devel
Code:
5) wget http://geolite.maxmind.com/download/geoip/api/mod_geoip2/mod_geoip2_1.2.5.tar.gz
Code:
6) tar xvzf mod_geoip2_1.2.5.tar.gz && cd mod_geoip2_1.2.5

Code:
7) apxs -i -a -L/usr/lib64 -I/usr/include -lGeoIP -c mod_geoip.c

8) Enabling mod-geoip
Nothing’s going to work unless mod-geoip is enabled in your apache configuration. You’ll need the following lines in your httpd.conf file (located on CentOS systems at /etc/httpd/conf/httpd.conf)

Code:
<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/local/share/GeoIP/GeoIP.dat Standard
GeoIPDBFile /usr/local/share/GeoIP/GeoLiteCity.dat Standard
</IfModule>

9) Restart Apache so your changes will take effect by entering the following command.

Code:
#/etc/init.d/httpd restart
Code:
10) /usr/local/bin/geoipupdate



Dinesh Kumar Mohanty
Ultra Web Solutions®
Bhubaneswar, Odisha, India.

UltratechHost - Your One Stop Offshore & Onshore Hosting Provider
Server Locations : Netherlands, Germany, Russia, Singapore & USA
Service Offers: Shared hosting | Reseller hosting | Cloud server | Dedicated server | VPS Hosting



Forum Jump:


Users browsing this thread: 1 Guest(s)