¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 160°Ç
   
command line À¸·Î À§Ä¡Á¶È¸
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2016-04-25 (¿ù) 09:40 Á¶È¸ : 4105
±ÛÁÖ¼Ò :
                          


¹æ¹ý1)
Ubuntu
# apt-get install geoip-bin

CentOS/RHEL
# yum install geoip

# geoiplookup chonnom.com
GeoIP Country Edition: KR, Korea, Republic of


Maxmide ¿¡¼­ ¹èÆ÷ÇÏ´Â µðºñ¸¦ ÀÌ¿ëÇؼ­ Á»´õ µðÅ×ÀÏÇÑ Á¤º¸¸¦ È®ÀÎ
 ¡Ø Maxmind ¿¡¼­ ¹èÆ÷ÇÏ´Â ¹öÀü¿¡´Â ¹«·á/À¯·Î ¹öÀüÀÌ Àִµ¥...±»ÀÌ À¯·Î¹öÀü »ç¿ëÇÒ ÇÊ¿ä¾øÀÌ ÇÑ´Þ¿¡ Çѹø ¾÷µ¥ÀÌÆ® ÇØÁÖ´Â ¹«·á¹öÀü¸¸À¸·Îµµ ÃæºÐÇÏ´Ù.

http://dev.maxmind.com/geoip/legacy/geolite/

# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
# wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
# wget http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

# gunzip GeoIP.dat.gz
# gunzip GeoIPASNum.dat.gz
# gunzip GeoLiteCity.dat.gz

# cp Geo* /usr/share/GeoIP/

# geoiplookup XXX.XXX.XXX.6
GeoIP Country Edition: KR, Korea, Republic of
GeoIP ASNum Edition: AS4766 Korea Telecom

GeoLiteCity µ¥ÀÌŸ¸¦ ÀÌ¿ëÇؼ­ ÁÖ, µµ½Ã, ¿ìÆí¹øÈ£, À§µµ, °æµµ È®ÀÎ
# geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat XXX.XXX.XXX.6
GeoIP City Edition, Rev 1: KR, 13, Kyonggi-do, Seongnam, N/A, 37.438599, 127.137802, 0, 0
¡Ø ¸ð¹ÙÀÏ ³×Æ®¿öÅ©´Â Á¤º¸°¡ »óÀÌÇÒ¼ö ÀÖÀ½


¹æ¹ý2)
¶Ç´Ù¸¥ ¹æ¹ýÀ¸·Î´Â...GeoIP µ¥ÀÌŸ¸¦ ÀÌ¿ëÇÏÁö ¾Ê°í ipinfo.io ¿¡¼­ Á¦°øÇÏ´Â ¼­ºñ½º¸¦ ÀÌ¿ëÇϴ°ÍÀÌ´Ù.
¿©±â¼­´Â curl À» ºñ·ÔÇØ jQuery, Node.js, Ruby, Python µî°ú °°Àº µµ±¸¸¦ ÀÌ¿ëÇØ JSON ±â¹ÝÀÇ À§Ä¡Á¤º¸ API¸¦ Á¦°øÇÑ´Ù.

# curl ipinfo.io/XXX.XXX.XXX.6
{
  "ip": "XXX.XXX.XXX.6",
  "hostname": "No Hostname",
  "city": "Seongnam-si",
  "region": "Gyeonggi-do",
  "country": "KR",
  "loc": "37.4386,127.1378",
  "org": "AS4766 Korea Telecom"
¡Ø ÇÏ·ç¿¡ API È£Ãâ Ƚ¼ö´Â 1000ȸ·Î Á¦ÇѵǾîÀÖÀ¸¸ç ±×ÀÌ»óÀº À¯·áÀÌ´Ù.


http://xmodulo.com/geographic-location-ip-address-command-line.html




À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.