Сен 032013
 

Установить для Apache2 Debian

apt- install -y  php5-geoip

Проверяем наличие модулей в (путь может отличатся, проверить наличие ов по указанным путям):

LoadModule geoip_module /usr/lib/apache2/modules/mod_geoip.so
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
GeoIPDBFile /usr/share/GeoIP/

Возможно подгружаемый модуль окажется, всяко может быть, ищите:

# /etc/apache2/mods-enabled/geoip.load
#nano /etc/apache2/mods-enabled/geoip.conf
#nano /etc/apache2/mods-available/geoip.conf

Копируем регулярно обновляемую базу городов:

# wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# gunzip GeoLiteCity.dat.gz
# mv GeoLiteCity.dat /var/lib/GeoIP/GeoLiteCity.dat
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
# gunzip GeoIP.dat.gz
# mv GeoIP.dat /var/lib/GeoIP/GeoIP.dat

Перегружаем Apache:

/etc/init.d/httpd restart

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)