geoip

2017/09/14 linux

GEOIP免费版本下载地址:

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

GeoLite Country

http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

GeoLite Country IPv6

http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz

GeoLite City

http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

GeoLite City IPv6 (Beta)

http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz

GeoLite ASN

http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz

GeoLite ASN IPv6

http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz

GEOIP2下载

https://dev.maxmind.com/geoip/geoip2/geolite2/

##GeoLite2 City
http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
##GeoLite2 Country
http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz

##GeoLite2 ASN (Autonomous System Number)
http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz

安装

https://dev.maxmind.com/geoip/legacy/install/country/

1.下载

wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

2.安装数据库

gunzip GeoIP.dat.gz
mkdir -p /usr/local/share/GeoIP/
mv GeoIP.dat /usr/local/share/GeoIP/

查询IP信息

https://dev.maxmind.com/geoip/geoip2/downloadable/#MaxMind_APIs 使用API查询,有多种语言的API,这里使用https://packagist.org/packages/geoip2/geoip2

自动更新

https://dev.maxmind.com/geoip/geoipupdate/

php 的c扩展,提高IP查询性能

https://github.com/maxmind/MaxMind-DB-Reader-php https://github.com/maxmind/libmaxminddb


Search

    Table of Contents