o/s : centos 7 / 6 x64
적용 : apache geoip module install
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@www ~]# yum install GeoIP GeoIP-devel GeoIP-data zlib-devel [root@www ~]# tar xvfz geoip-api-mod_geoip2-1.2.9.tar.gz [root@www ~]# cd geoip-api-mod_geoip2-1.2.9 [root@www geoip-api-mod_geoip2-1.2.9]# /usr/local/apache/bin/apxs -i -a -L /usr/lib64 -I /usr/include/ -lGeoIP -c mod_geoip.c See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- chmod 755 /usr/local/apache/modules/mod_geoip.so |
httpd.conf 에 적용
1 2 3 4 5 6 7 8 9 10 |
[root@www geoip-api-mod_geoip2-1.2.9]# vi /usr/local/apache/conf/httpd.conf LogFormat "%V %h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\" %{Host}i %{GEOIP_COUNTRY_CODE}e" vcommon <IfModule geoip_module> GeoIPEnable On GeoIPEnableUTF8 On GeoIPOutput Env GeoIPDBFile /usr/share/GeoIP/GeoIP.dat GeoIPDBFile /usr/share/GeoIP/GeoLiteCity.dat </IfModule> |
access.log 에서 확인
1 2 3 4 |
173.245.48.173 - - [24/May/2018:09:19:24 +0900] "GET /wp-content/themes/Blog_Shop/openSrc/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0 HTTP/1.1" 301 319 "http://xinet.kr/wp-content/themes/Blog_Shop/openSrc/font-awesome-4.7.0/css/font-awesome.min.css?ver=4.7.0" "Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)" US 172.69.33.175 - - [24/May/2018:09:19:24 +0900] "GET /wp-content/themes/Blog_Shop/webfont/NanumGothic-Bold.woff2?20991231 HTTP/1.1" 301 292 "http://xinet.kr/wp-content/themes/Blog_Shop/css/webfont-local.css?ver=1" "Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)" US 172.68.46.103 - - [24/May/2018:09:19:24 +0900] "GET /wp-content/themes/Blog_Shop/webfont/NanumGothic-Regular.woff2?20991231 HTTP/1.1" 301 295 "http://xinet.kr/wp-content/themes/Blog_Shop/css/webfont-local.css?ver=1" "Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)" US 162.158.59.174 - - [24/May/2018:09:19:25 +0900] "GET /wp-content/themes/Blog_Shop/openSrc/font-awesome-4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0 HTTP/1.1" 301 318 "http://xinet.kr/wp-content/themes/Blog_Shop/openSrc/font-awesome-4.7.0/css/font-awesome.min.css?ver=4.7.0" "Mozilla/5.0 (compatible; Baiduspider-render/2.0; +http://www.baidu.com/search/spider.html)" US |