基于 Redis 协议的IP查询库
composer install --no-dev -o -n
内包含 crontab 定期执行 geoipupdate,需要配置环境参数 GEOIPUPDATE_ACCOUNT_ID
, GEOIPUPDATE_LICENSE_KEY
REDIS=<REDIS_HOST>:<REDIS_PORT>
WORKER_NUM=2 # 启动进程数,1 个 CPU数, 一个进程数
GEOIPUPDATE_ACCOUNT_ID=<YOUR_ACCOUNT_ID_HERE> # 必须
GEOIPUPDATE_LICENSE_KEY=<YOUR_LICENSE_KEY_HERE> # 必须
docker-compose up -d
php ./bin/serve-http
curl "http://localhost:9502/?ip=114.114.114.114"
php ./bin/serve-http
redis-cli --raw -p 9501 GET "114.114.114.114"
0 13 * * 1 /PATH/TO/ip-query/bin/geoipupdate.sh