首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏喵了个咪的博客空间

    全球IP库-GeoLite2-City

    [喵咪开源软件推荐(3)]全球IP库-GeoLite2-City #w-blog博客 哈喽大家好啊!喵咪开源软件推荐(3)终于和大家见面了,这次我们来说说什么呢? 附上: 喵了个咪的博客:w-blog.cn geolite2 下载地址 :http://dev.maxmind.com/geoip/geoip2/geolite2/ geoip2-golang 项目地址 准确的解析出了中国湖南长沙并且还有多国语言的称呼,笔者在试了试通过手机移动网来进行的解析,笔者在上海市杨浦区获得的经纬度是 31.0456,121.3997,但是具体经纬度结果还是相差甚远 3 总结 GeoLite2

    6.1K70发布于 2018-03-02
  • 用Nginx轻松实现国际化访问!不同国家用户看到不同页面的完整攻略

    edition_id=GeoLite2-Country&license_key=YOUR_LICENSE_KEY&suffix=tar.gz -O GeoLite2-Country.tar.gz 这里要注意 解压数据库文件: (下载不了可以后台联系找我要) tar -xzf GeoLite2-Country.tar.gz cp GeoLite2-Country_*/GeoLite2-Country.mmdb cp GeoLite2-Country_*/GeoLite2-Country.mmdb . /GeoLite2-Country.mmdb.new mv GeoLite2-Country.mmdb.new GeoLite2-Country.mmdb nginx -s reload rm -rf GeoLite2-Country_* GeoLite2-Country-new.tar.gz 加到crontab里每月执行一次: 0 2 1 * * /path/to/update_geoip.sh 坑

    32810编辑于 2026-01-26
  • 来自专栏用户9257747的专栏

    全网的 IP 归属地显示,带你5分钟加上,就是这么简单!

    其实要想实现这个功能还是非常的容易,基于现成 GeoLite2离线库+免费的在线解析资源,5分钟就能整合了; 在整合之前,我们先简单了解一下,要想拿到用户的位置信息,有那些方式: 终端定位 我们的手机等电子设备都是带有 免费 IP 库整合值SpringBoot项目,来获取用户的归属地信息; 1什么是GeoLite2? GeoLite2数据库是免费的IP地理定位数据库; 优点: 离线库,不需要网络 数据库丰富 速度快 免费 缺点: 准确度不高,存在偏差 数据更新慢 2下载 GeoLite2 离线库 官网地址:https 5GeoLite2的其他用法 上面介绍的时SpringBoot整合GeoLite2,同样在其他的一些场景下,也是可以利用GeoLite2获取归属地信息; 整合至Nignx,获取用户归属地信息 Nginx 整合 GeoLite2 来解析用户的归属地信息,在代理层就直接整理好对应的数据; ELK中整合GeoLite2 ELK 日志整理的时候,可以通过GeoLite2 获取用户的IP归属地信息;然后通过Kibana

    3K10编辑于 2022-05-17
  • 来自专栏全栈工程师修炼之路

    9.Nginx实践之使用MaxMind的GeoIP2实现处理不同国家或城市的访问最佳实践指南

    数据库下载 描述: Nginx 的 ngx_*_geoip2_module 模块依赖于 GeoLite2 数据库, 免费的 GeoLite2 数据库可从 Maxminds 网站获得(需要注册),GeoLite2 _20220802.tar.gz tar -zxf GeoLite2-City_20220802.tar.gz tar -zxf GeoLite2-Country_20220802.tar.gz # 将 mmdb 文件复制到 /usr/local/GeoIP2 目录下 mv GeoLite2-City_20220802/GeoLite2-City.mmdb /usr/local/GeoIP2/ mv GeoLite2-Country_20220802/GeoLite2-Country.mmdb /usr/local/GeoIP2/ rm -rf GeoLite2-City_20220802/ GeoLite2 GeoLite2 数据库自动更新 描述: 为了保证数据库中国家与城市的准确性,我们需要设置cron定时任务来更新MaxMind提供的GeoLite2-Country.mmdb或者GeoLite2-City.mmdb

    7.8K10编辑于 2022-09-29
  • 来自专栏网络随笔

    【玩转Lighthouse】搭建网站统计程序——Matomo

    这里,我们介绍Maxmind GeoLite 2 数据库的安装和使用。 首先,您需要去Maxmind官网上注册一个免费帐户,并申请一个免费的GeoLite2 License密钥。 地址是https://dev.maxmind.com/geoip/geoip2/geolite2/ 申请的密钥请牢记,因为之后在网上是看不到密钥的。 保存好密钥之后,登录SSH, 下载GeoLite 2 City级别的IP地理位置数据库。 下载下来的数据库是一个压缩包,我们解压之后,将里面的GeoLite2-City.mmdb文件复制粘贴到Matomo安装目录的/misc/文件夹下。 以我这里为例: 123 tar zxvf GeoLite2-City.tar.gzcd GeoLite2-City_2020*mv GeoLite2-City.mmdb /srv/www/132020.

    1.9K32编辑于 2022-04-12
  • 来自专栏用户4480853的专栏

    异步任务实战之远程拉取和风天气API 发布于

    那么可以将这个过程大致拆分成如下的几个步骤: graph LR A[拉取 GeoLite2] --> B[获取请求IP] B --> C[查询GeoLite2经纬度] C --> 正式开发 远程拉取GeoLite2 阅读和风天气的城市实时天气API文档内容我们可以知道,要想获取用户所在城市的天气则需要先获取该城市ID。 使用GeoLite2.mmdb数据库是一个不错的选择,它可以帮助我们直接分析出用户IP地址所在的经度和纬度。 而我们所需要做的第一步就是就是在应用启动时从https://cdn.jsdelivr.net/npm/geolite2-city@1.0.0/GeoLite2-City.mmdb.gz上将这个文件拉取下来 if (Files.exists(Path.of(unzipPath))) { log.info("detected file GeoLite2-City.mmdb at {}

    60630编辑于 2023-10-21
  • 来自专栏fred 随笔

    Tengine编译GeoIP2

    下载geoip2数据 git clone https://gitee.com/ZTfred/nginx-geoip2.git cd nginx-geoip2 tar -zxvf GeoLite2-City /GeoLite2-City_20200519/GeoLite2-City.mmdb /usr/share/GeoIP/ tar -zxvf GeoLite2-Country_20200519.tar.gz /GeoLite2-Country_20200519/GeoLite2-Country.mmdb /usr/share/GeoIP/ 3. ,使其生效 vim /usr/local/tengine/conf/nginx.conf # 增加配置信息 # geoip2 配置 geoip2 /usr/share/GeoIP/GeoLite2 iso_code; $geoip2_data_country_name country names en; } geoip2 /usr/share/GeoIP/GeoLite2

    99940编辑于 2022-08-30
  • 来自专栏HHTjim'S 部落格

    Nginx 内嵌GeoIP库

    次 发布时间:2025-06-05 分类:零零星星 | 无评论 » nginx可以内置IP地址解析功能,无需依赖三方 api 免费的geoip库文件下载: https://git.io/GeoLite2 -City.mmdb -o /etc/nginx/geoip/GeoLite2-City.mmdb # nginx.conf 顶部载入模块 RUN echo 'load_module modules/ sh -c 'set -e; curl -Ls --retry 3 --retry-delay 5 --connect-timeout 10 --max-time 60 https://git.io/GeoLite2 -City.mmdb -o /tmp/geo.mmdb; \ [ -s /tmp/geo.mmdb ]; cp /etc/nginx/geoip/GeoLite2-City.mmdb /etc/nginx /geoip/GeoLite2-City.mmdb.bak; \ mv /tmp/geo.mmdb /etc/nginx/geoip/GeoLite2-City.mmdb'

    49910编辑于 2025-06-06
  • 来自专栏架构进阶

    Mac下Elasticsearch7.x安装及Springboot集成

    : Connect timed out 错误信息是Elasticsearch 在启动时尝试下载 GeoIP 数据库(GeoLite2-ASN.mmdb)时连接超时。 /raw/download/GeoLite2-ASN.mmdb curl -O https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2- City.mmdb curl -O https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-Country.mmdb cd ../.. 注意: https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb这个源git地址也很可能无法下载,所以需要改为使用其他公开源的地址 -ASN.mmdb # 华为云镜像 curl -O https://repo.huaweicloud.com/geoip/GeoLite2-ASN.mmdb 2.

    62500编辑于 2025-08-12
  • 来自专栏Linux云计算及前后端开发

    第十三章·Kibana深入-使用地图统计客户端IP

    版本下载地址:http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz #进入Logstash目录 [root@elkstack03 ~]# cd /etc/logstash/ #下载地址库 [root@elkstack03 logstash]# wget http://geolite.maxmind.com/download/geoip /database/GeoLite2-City.tar.gz #解压地址库文件 [root@elkstack03 logstash]# tar xf GeoLite2-City.tar.gz #查看地址库文件 -City_20190409 -rw-r--r-- 1 root root 29444833 4月 9 15:32 GeoLite2-City_20190409.tar.gz -rw-rw-r-- -City_20190409/GeoLite2-City.mmdb" add_field => [ "[geoip][coordinates]", "%{[geoip][

    1.4K40编辑于 2022-09-26
  • 来自专栏Java修行之道

    Nginx拦截指定国家的IP

    Nginx拦截指定国家的IP 一、下载GeoIP数据库 wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz wget http ://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget http://geolite.maxmind.com/download

    2.5K10发布于 2019-02-25
  • 来自专栏Java开发

    Kibana使用高德地图

    在logstash服务器下载IP地址归类查询库 [root@localhost ~]# wget http://geolite.maxmind.com/download/geoip/database/GeoLite2 -City.mmdb.gz [root@localhost ~]# gunzip GeoLite2-City.mmdb.gz 编辑logstash配置文件 input { stdin {} } source => "message" target => "geoip" database => "/usr/local/logstash-5.1.1/config/GeoLite2

    3.2K20发布于 2018-09-06
  • 来自专栏孟君的编程札记

    小课堂 | 根据ip获取城市名

    GeoLite2和ip2region一样,先准备离线数据包、导入依赖包。 代码步骤: 1、准备db文件,如在src/main/resource目录下创建data目录,存放GeoLite2-City.mmdb文件 2、引入geolite2依赖包 <dependency> groupId> <artifactId>geoip2</artifactId> <version>2.14.0</version> </dependency> 3、读取GeoLite2 try { InputStream database = Ip2CityUtil.class.getClassLoader().getResourceAsStream("data/GeoLite2 4、相关库下载 资源下载 https://pan.baidu.com/s/4pRI9z2F GeoLite2的信息很全面,但相对而言其准确率并不是很精确。ip2region相对较准确点。

    5K20发布于 2021-11-16
  • 来自专栏RokasYang

    利用Wireshark与Geolite地址库进行IP定位、地图分布可视化及特征报文深入分析

    本文将介绍如何使用MaxMind地址库(包括GeoLite2 ASN、GeoLite2 City和GeoLite2 Country)结合Wireshark进行IP地理位置信息的解析与分析,以及通过Wireshark 二、获取MaxMind地址库在MaxMind官网注册并登录账号后,在GeoIP地址库下载页面下载地址库压缩包:主要下载三个文件:地址库 描述 GeoLite2 ASN AS号地址库GeoLite2 City 城市地址库GeoLite2 Country国家地址库想要保持相对更为准确的地址库数据,建议定期更新一次地址库。 六、总结本文详细介绍了如何利用MaxMind地址库(包括GeoLite2 ASN、GeoLite2 City和GeoLite2 Country)与Wireshark结合,对抓包捕获文件的IP地理位置信息进行深度分析

    3.1K144编辑于 2024-08-09
  • 来自专栏安徽开发者圈

    SpringBoot 系列-资源访问

    public void init() { try { LOGGER.info("GeoLocationServiceImpl: Trying to load GeoLite2 -Country database..."); Resource resource = resourceLoader.getResource("classpath:GeoLite2 public void init() { try { LOGGER.info("GeoLocationServiceImpl: Trying to load GeoLite2 -Country database..."); Resource resource = resourceLoader.getResource("classpath:GeoLite2

    71910发布于 2020-03-02
  • 来自专栏Web技术布道师

    如何设置根据不同的IP地址所在地域访问不同的服务?

    GeoIP2将数据库从GeoIP.dat换成 GeoLite2-Country.mmdb 。 问题2:我们使用的是docker的nginx镜像,如何在docker镜像中安装nginx插件。 步骤二:下载IP数据库 wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz gunzip GeoLite2-Country.mmdb.gz gunzip GeoLite2-City.mmdb.gz 步骤三:测试服务可用性 docker run -d --name nginx wencst/nginx docker exec -it 基本命令: mmdblookup --file /usr/share/GeoIP/GeoLite2-Country.mmdb --ip 8.8.8.8 访问某一个域: mmdblookup

    5.4K20发布于 2019-03-13
  • 来自专栏czwy的博客

    使用.NET查询日出日落时间

    GeoLite2也是提供了CSV和mmdb两种格式数据库,并根据内容不同分为GeoLite2 Country、GeoLite2 City、GeoLite2 ASN三个版本,详细信息参见GeoLite2 这里以GeoLite2 City.mmdb为例介绍如何使用。 首先,下载GeoLite2-City.mmdb数据库文件,然后在项目中通过Nuget引用MaxMind.GeoIP2包。 调用代码如下: using (var reader = new DatabaseReader(@"C:\Users\John\Downloads\GeoLite2-City.mmdb")) { 最新(2024-5-7下载)的GeoLite2数据库中查询到20071个中国的IP网段,其中有11270条是未查询到具体城市信息的记录。 IP2Location Lite和GeoLite2数据库的覆盖情况并没有一个确切的数据,两个数据库结合使用或许能提高查询命中率。

    2.3K10编辑于 2024-05-10
  • 来自专栏golang算法架构leetcode技术php

    golang源码分析之geoip2-golang

    https://github.com/oschwald/geoip2-golang用来解析 [GeoLite2](http://dev.maxmind.com/geoip/geoip2/ geolite2/) and [GeoIP2](http://www.maxmind.com/en/geolocation_landing)数据库的一个工具包。 /GeoLite2-City.mmdb") if err ! country code: GB // Time zone: Europe/London // Coordinates: 51.5142, -0.0931 } 非常简单,加载GeoLite2 比如城市信息: // The City struct corresponds to the data in the GeoIP2/GeoLite2 City // databases. type City

    1K21编辑于 2022-08-02
  • 来自专栏johnhuster

    将ip转换为地理位置存入elasticsearch

    有些需要将一些数据基于地址位置进行分析,比如哪些区域比较活跃,在什么时间范围内活跃,但是后端仅能获取ip地址,因此需要将ip地址转换为地理位置,幸运的是我们有开源的工具可以使用,maxmind/GeoIP2-java使用GeoLite2 -City.mmdb库就可以由ip分析得到对应的经纬度,下面给出具体操作步骤: 1、从https://dev.maxmind.com/geoip/geoip2/geolite2/下载免费的GeoLite2 bulkRequest.timeout("2m"); DatabaseReader reader = null; try { Resource resource = new ClassPathResource("GeoLite2

    1.4K51编辑于 2022-03-29
  • 来自专栏MCNU云原生

    记一次Elasticsearch GeoIpDownloader的启动异常排查排查过程

    34:10,144][WARN ][o.e.i.g.GeoIpDownloader ] [node1] could not delete old chunks for geoip database [GeoLite2 Elasticsearch的时候运行是正常的,并没有出现这个错误,从日志来看,确实Elasticsearch自动创建了一个名为.geoip_databases的索引,并且自动下载了geoip数据库,名为GeoLite2 -14T14:30:43,929][INFO ][o.e.i.g.GeoIpDownloader ] [node1] successfully downloaded geoip database [GeoLite2 14T14:30:44,355][INFO ][o.e.i.g.DatabaseNodeService] [node1] successfully loaded geoip database file [GeoLite2

    2.1K30编辑于 2023-02-22
领券