» 2016 » July の記事

~ Install Mod_GeoIP in centos ~

connie 2016.07.13 | apache | | No Comments
yum update

yum install mod_geoip GeoIP GeoIP-devel GeoIP-data zlib-devel

cd/usr/share/GeoIP/
mv GeoIP.dat GeoIP.dat_org
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz

nano /etc/httpd/conf/httpd.conf
<IfModule mod_geoip.c>
GeoIPEnable On
GeoIPDBFile /usr/share/GeoIP/GeoIP.dat
</IfModule>
nano /var/www/html/testgeoip.php
<?
var_dump(getenv(GEOIP_COUNTRY_NAME))

 

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

nano /etc/yum.repos.d/epel.repo

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

uncomment baseurl and comment mirror

| HOME |