α | ȸ | | Ʈ

  • ġ
HOME > >
| ¼ҽ õ ¸ ֽϴ.
 
ġ GeoIP ̿
ȸ : 10,797  


ġ GeoIP ̿


û û Ŭ̾Ʈ Ǹ мϿ ش Ǻϰ

ϴ ˾ƺ ϰڴ.


1. غ

GeoIP͸ apache ϱؼ mod_geoip ġϱ⿡ ռ
GeoIP C API ġϿ Ѵ .

ٿε : http://www.maxmind.com/app/c

ġ : # ./configure --prefix=/usr/local/GeoIP
        # make
        # make install


2. ġ ϱ

ġ DSO ϵ Ǿ־Ѵ

׸ Ͻ  ̺귯 Ŭ θ ߰صξѴ

    ̺귯 : -L /usr/local/GeoIP/lib
    Ŭ     : -I  /usr/local/GeoIP/include

ٿε  : http://www.maxmind.com/app/mod_geoip

ġ   : apxs -ci  -L /usr/local/GeoIP/lib -I  /usr/local/GeoIP/include -l GeoIP -c mod_geoip.c


ġ   php ġǾ ִٸ phpinfo ϰ Ȯ̰ϴ .

Apache Environment κп

GEOIP_CONTINENT_CODE, GEOIP_COUNTRY_CODE, GEOIP_COUNTRY_NAMEȯ ִ.

׸ ش ̺귯Ǽġ Ϸ Ǿ

GeoIP ͸ ٿ޾ƾ Ѵ

ٿε : http://www.maxmind.com/app/products

ġ : /usr/local/GeoIP/share/GeoIP/GeoIP.dat



3.  ġ ϱ

Ư ϱؼ ƷͰ ߰ϸȴ

<IfModule geoip_module>
        GeoIPEnable On
        GeoIPDBFile /usr/local/GeoIP/share/GeoIP/GeoIP.dat

        <Location /image>
           SetEnvIf GEOIP_COUNTRY_CODE CN go_out
           SetEnvIf GEOIP_COUNTRY_CODE RU go_out
           SetEnvIf GEOIP_COUNTRY_CODE TH go_out

           <Limit GET POST>
             Order Allow,Deny
             Allow from all
             Deny  from env=go_out
           </Limit>

    </Location>

</IfModule>

ݴ Ư Ұ Ʒ ϸ ȴ .

<IfModule geoip_module>
        GeoIPEnable On
        GeoIPDBFile /usr/local/GeoIP/share/GeoIP/GeoIP.dat

        <Location /image>
           SetEnvIf GEOIP_COUNTRY_CODE KR go_in

           <Limit GET POST>
             Order Deny,Allow
             Deny from all
             Allow  from env=go_in
           </Limit>

    </Location>

</IfModule>


4. (GeoIP ̿ α)

ġ α׿  GeoIP ̿Ͽ ڵ带 Ǹ ߻ whois ̿Ͽ ȸ ʴ

ٷ ľ ϸ ׿ ġ ϴ

<IfModule geoip_module>
        GeoIPEnable On
        GeoIPDBFile /usr/local/GeoIP/share/GeoIP/GeoIP.dat
</IfModule>

LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i" %{Host}i %{GEOIP_COUNTRY_CODE}e"  geoiplog

CustomLog logs/access_log geoiplog

[۸ũ] : https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1580


  Ʈͷ   ̽   ̷

 
: 缮
e-mail : loclisuperuser.co.kr
Ҽ : ()ڸ