emAmazed / redlamp

Bloggie Bloggie
MIT License
0 stars 1 forks source link

GeoMap Location Info #17

Open emAmazed opened 9 years ago

emAmazed commented 9 years ago

Install MaxMind Command line GeoIP databases,

To install geoiplookup on Debian, Ubuntu or Linux Mint:

sudo apt-get install geoip-bin

To install geoiplookup on CentOS, first enable EPEL repository.

sudo yum install geoip

Look up IP GeoInfo

geoiplookup xxx.xxx.xxx.xxx

Install additional GeoIP databases from MaxMind, set up a monthly cron job

wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz wget -N http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz wget -N http://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz gunzip GeoLiteCity.dat.gz gunzip GeoIP.dat.gz gunzip GeoIPASNum.dat.gz sudo cp GeoIP.dat GeoLiteCity.dat GeoIPASNum.dat /usr/share/GeoIP/

Obtain City leve geolocation info

geoiplookup -f /usr/share/GeoIP/GeoLiteCity.dat xxx.xxx.xxx.xxx

Using JSON-based geolocation API to obtain GeoIP information

curl ipinfo.io/xxx.xxx.xxx.xxxx