%20
[plain]view%20plaincopy
%20
%20
#ThefollowingUserIdandLicenseKeyarerequiredplaceholders:%20
%20UserId999999%20
%20LicenseKey000000000000#IncludeoneormoreofthefollowingProductIds:%20
%20#*GeoLite2-City-GeoLite2City%20
%20#*GeoLite2-Country-GeoLite2Country%20
%20#*506-GeoLiteLegacyCountry%20
%20#*517-GeoLiteLegacyASN%20
%20#*533-GeoLiteLegacyCity#dat格式%20
%20#ProductIdsGeoLite2-CityGeoLite2-Country506533#mmdb格式%20
%20ProductIdsGeoLite2-CityGeoLite2-Country132106%20
c、执行更新
%20
查看geoipupdate帮助文件,了解有哪些参数可以使用!%20-d%20参数将文件下载到指定目录,-v%20参数就是显示下载过程明细信息。
%20
%20
[plain]view%20plaincopy
%20
%20
$/usr/local/bin/geoipupdate-h%20
%20Usage:geoipupdate[-Vhv][-flicense_file][-dcustomdirectory]-dDIRstoredownloadedfilesinDIR%20
%20-fFILEuseconfigurationfoundinFILE(seeGeoIP.conf(5)manpage)%20
%20-hdisplaythishelptext%20
%20-vuseverboseoutput%20
%20-Vdisplaytheversionandexit%20
执行更新命令,看网络情况,本文将文件下载到%20/mnt/data/geolite2/目录%20。mmdb
%20
[plain]view%20plaincopy
%20
%20
$ll/mnt/data/geolite2/&&cd$_%20
%20总用量0%20
%20$sudo/usr/local/bin/geoipupdate-d/mnt/data/geolite2/-v%20
%20$ll%20
%20总用量34088%20
%20-rw-r--r--.1rootroot3255361112月1918:14GeoLite2-City.mmdb%20
%20-rw-r--r--.1rootroot234940612月1918:14GeoLite2-Country.mmdb%20
如何配置计划任务定时更新%20GeoLite2%20请自行解决。
%20
三、安装GeoLite2API%20调用程序
%20
官方提供%20.NET%20(C#)、C、Java、Perl、Python、Apache%20API调用。其他第三方接口也有,但官方不提供技术支持,详情点击这里。
%20
本文使用%20C%20语言API接口进行调用测试,为下篇文章Nginx与GeoIP2配合做铺垫。其他语言请参考官方指导自行解决!C语言API%20GitHub%20下载地址
%20
%20
[plain]view%20plaincopy
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-34365-2.html
不制造地区紧张武器怎么能好卖呢
开打就等于美国放弃了他的霸主地位