Installation Of GeoIP (Centos, Red Hat)

GeoIP is a library to determine the country, city, organization which is an IP address.
PHPgeoip module for use of library functions in PHP.
We Put:
Add repository EPHEL:
# rpm-Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm
Install GeoIP using yum:
# yum install geoip geoip-devel
Download and copy the address database in the desired location:
# cd/tmp
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
# gunzip./GeoIP.dat.gz
# rm/usr/share/GeoIP/GeoIP.dat
# mv/GeoIP.dat/usr/share/GeoIP/GeoIP.dat.
Install the PHP extension:
# echo “extension = geoip.so > >/etc/php.ini
# pecl install geoip
If a command has an error: pecl.php.net is using a
unsupported protocalThis should never happen. install failed “
you could do the following:
# cd ‘ pecl config-get php_dir
# mv. channels. channels-broken
# pecl update-channels
And again:
#pecl install geoip
Restart Apache:
#/etc/init.d/httpd restart
or php-fpm:
#/etc/init.d/php-fpm restart