ГлавнаяРегистрацияВходВ закладки

Главная » Статьи » CentOS » Безопасность
Установка GeoIP на Centos
Как установить GeoIP на Centos

Процесс установки следующий:

1. Добавляем репозитарий EPEL:

# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-2.noarch.rpm

2. Устанавливаем GeoIP:

# yum install geoip geoip-devel
# yum install httpd mod_geoip

3. Скачиваем самую свежую базу:

# 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

4. Устанавливаем расширение PHP:

# echo "extension=geoip.so" >>/etc/php.ini
# pecl install geoip

5. Если почему-то команда вывела ошибку: “pecl.php.net is using a unsupported protocal – This should never happen.install failed” то тогда надо сделать следующее:

# cd `pecl config-get php_dir`
# mv .channels .channels-broken
# pecl update-channels

И далее снова повторить:

#pecl install geoip

6. Перезапустить:


# httpd -t
Syntax OK
# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
Просмотров: 4632
Дата: 2011-08-07 01:09:53
Комментариев: 0
Источник: