{"id":3982,"date":"2012-03-11T21:11:05","date_gmt":"2012-03-11T12:11:05","guid":{"rendered":"http:\/\/mimumimu.net\/blog\/?p=3982"},"modified":"2013-02-07T01:01:18","modified_gmt":"2013-02-06T16:01:18","slug":"geoiplookup-%e3%81%a7%e7%99%ba%e4%bf%a1%e5%85%83%e3%82%92%e3%81%bf%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/mimumimu.net\/blog\/2012\/03\/11\/geoiplookup-%e3%81%a7%e7%99%ba%e4%bf%a1%e5%85%83%e3%82%92%e3%81%bf%e3%82%8b%e3%80%82\/","title":{"rendered":"geoiplookup \u3067\u767a\u4fe1\u5143\u3092\u307f\u308b\u3002"},"content":{"rendered":"<p>\u306a\u3093\u3068\u306a\u304f\u3001\u30b5\u30fc\u30d0\u7ba1\u7406\u3092\u3057\u3066\u3044\u308b\u4eba\u306a\u3089\u3001    <br \/>\u3069\u3053\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3055\u308c\u3066\u304d\u305f\u3093\u3060\u308d\u3046\u3068\u304b\u6c17\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u306f\u305a\u3002<\/p>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u3001 GeoIP \u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3063\u3066\u3001\u3069\u3053\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304d\u305f\u304b\u3092\u898b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>&#160;<\/p>\n<h3>\uff11\uff0e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/h3>\n<p>CentOS \u3068\u304b Fedora \u3060\u3068\u3001 <u><strong>geoip<\/strong><\/u> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u5165\u308a\u307e\u3059\u3002<\/p>\n<div id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:70dacad3-65f0-4671-8a92-50c7663c158f\" class=\"wlWriterSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<pre class=\"brush: bash;\"># yum install geoip<\/pre>\n<\/div>\n<p>Ubuntu \u3055\u3093\u3068\u304b LinuxMint \u3055\u3093\u3082\u540c\u3058\u306a\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&#160;<\/p>\n<h3>\uff12\uff0e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u66f4\u65b0\u3059\u308b\u3002<\/h3>\n<p>MaxMind GeoIP Country Database<\/p>\n<p><a title=\"http:\/\/www.maxmind.com\/app\/geolitecountry\" href=\"http:\/\/www.maxmind.com\/app\/geolitecountry\">http:\/\/www.maxmind.com\/app\/geolitecountry<\/a><\/p>\n<p>MaxMind GeoIP City Database<\/p>\n<p><a title=\"http:\/\/www.maxmind.com\/app\/geolitecity\" href=\"http:\/\/www.maxmind.com\/app\/geolitecity\">http:\/\/www.maxmind.com\/app\/geolitecity<\/a><\/p>\n<p>\u3053\u306e\uff12\u3064\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p><a title=\"http:\/\/www.maxmind.com\/app\/installation?city=1\" href=\"http:\/\/www.maxmind.com\/app\/installation?city=1\">http:\/\/www.maxmind.com\/app\/installation?city=1<\/a><\/p>\n<p>\u3053\u306e\u30da\u30fc\u30b8\u306b\u5f93\u3044\u307e\u3059\u3068\u3001<\/p>\n<div id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:557d2f45-998c-48e6-9ba2-3efc9fff2f21\" class=\"wlWriterSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<pre class=\"brush: bash;\"># wget http:\/\/geolite.maxmind.com\/download\/geoip\/database\/GeoLiteCity.dat.gz\n# wget http:\/\/geolite.maxmind.com\/download\/geoip\/database\/GeoLiteCountry\/GeoIP.dat.gz\n# gzip -d GeoLiteCity.dat.gz\n# gzip -d GeoIP.dat.gz\n# mv GeoIP.dat \/usr\/share\/GeoIP\/\n# mv GeoLiteCity.dat \/usr\/share\/GeoIP\/GeoIPCity.dat<\/pre>\n<\/div>\n<p>\u3068\u3044\u3046\u611f\u3058\u3067\u3057\u3087\u3046\u304b\uff57<\/p>\n<p>&#160;<\/p>\n<h3>\uff13\uff0e\u4f7f\u3046\u3002<\/h3>\n<div id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a648c0de-c04c-45c6-b0d4-4f85dd3fb361\" class=\"wlWriterSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<pre class=\"brush: bash;\">$ geoiplookup 111.89.178.190\nGeoIP Country Edition: JP, Japan\nGeoIP City Edition, Rev 1: JP, 40, Tokyo, N\/A, 35.685001, 139.751404, 0, 0\nGeoIP City Edition, Rev 0: JP, 40, Tokyo, N\/A, 35.685001, 139.751404<\/pre>\n<\/div>\n<p>\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<p><a href=\"http:\/\/mimumimu.net\/blog\/wp-content\/uploads\/2012\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/mimumimu.net\/blog\/wp-content\/uploads\/2012\/03\/image_thumb.png\" width=\"536\" height=\"416\" \/><\/a><\/p>\n<p>\u3061\u306a\u307f\u306b\u5730\u56f3\u306f\u3053\u3093\u306a\u6240\u51fa\u3057\u3066\u307e\u3059\u304c\u3001<\/p>\n<div id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:9eb4295d-7f90-4dd1-b17b-106a4b71ff4d\" class=\"wlWriterSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<pre class=\"brush: bash;\">$ nslookup sony.ne.jp\nServer:         192.168.1.3\nAddress:        192.168.1.3#53\n\nNon-authoritative answer:\nName:   sony.ne.jp\nAddress: 111.89.178.190<\/pre>\n<\/div>\n<p>\u3053\u306e\u5834\u6240\u306b\u6c11\u9593\u4f01\u696d\u304c\u3042\u308b\u3068\u306f\u601d\u3048\u306a\u3044\u306e\u3067\u3001<\/p>\n<p>\u4f4d\u7f6e\u306e\u305a\u308c\u3092\u611f\u3058\u308b\u308f\u3051\u3067\u3059\u304c\u3002<\/p>\n<p>\uff08\u3053\u306e\u4f01\u696d\u3055\u3093\u306b\u306f\u3001\u30ce\u30fc\u30c8\u30d1\u30bd\u30b3\u30f3\u3067\u4e3b\u306b\u304a\u4e16\u8a71\u306b\u306a\u3063\u3066\u304a\u308a\u307e\u3059\u308b\uff09<\/p>\n<p>&#160;<\/p>\n<p>\u3067\u3082\u3001\u56fd\u306e\u5224\u5b9a\u3068\u304b\u305d\u308c\u3050\u3089\u3044\u306b\u306f\u4f7f\u3048\u305d\u3046\u3002<\/p>\n<p>\u3042\u304f\u307e\u3067\u3082\u6c17\u4f11\u3081\u30fb\u30fb\u3067\u3059\u304c\uff57<\/p>\n<p>&#160;<\/p>\n<h3>\uff14\uff0e\u9069\u5f53\u306b\u4f7f\u3063\u3066\u307f\u308b\u3002<\/h3>\n<div id=\"scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d4e17587-06e9-433c-b879-d92032a905f3\" class=\"wlWriterSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<pre class=\"brush: bash;\">$ cat access.log* | cut -f1 -d&quot; &quot; | sort | uniq | awk '{ print system(&quot;geoiplookup &quot; $1) }'<\/pre>\n<\/div>\n<p>\u305f\u3068\u3048\u3070\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<p>Apache \u306e\u30ed\u30b0\u304b\u3089IP \u30a2\u30c9\u30ec\u30b9\u51fa\u3057\u3066\u304d\u3066\u3001geoiplookup \u306b\u639b\u3051\u307e\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u52d5\u4f5c\u30b5\u30f3\u30d7\u30eb\u306f\u500b\u4eba\u60c5\u5831\u304c\u3082\u308d\u3082\u308d\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u6b62\u3081\u307e\u3059\u304c\u3002<\/p>\n<p>\u3067\u3042\u3067\u3042\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u3093\u3068\u306a\u304f\u3001\u30b5\u30fc\u30d0\u7ba1\u7406\u3092\u3057\u3066\u3044\u308b\u4eba\u306a\u3089\u3001 \u3069\u3053\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3055\u308c\u3066\u304d\u305f\u3093\u3060\u308d\u3046\u3068\u304b\u6c17\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u306f\u305a\u3002 \u3068\u3044\u3046\u308f\u3051\u3067\u3001 GeoIP \u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u3063\u3066\u3001\u3069\u3053\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304d\u305f\u304b\u3092\u898b\u3066\u307f\u307e\u3059\u3002 &#160; \uff11\uff0e\u30a4 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,12],"tags":[28,29],"class_list":["post-3982","post","type-post","status-publish","format-standard","hentry","category-unix-linux","category-software","tag-geoiplookup","tag-29"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts\/3982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/comments?post=3982"}],"version-history":[{"count":0,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/posts\/3982\/revisions"}],"wp:attachment":[{"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/media?parent=3982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/categories?post=3982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mimumimu.net\/blog\/wp-json\/wp\/v2\/tags?post=3982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}