Here we will introduce several free IP database updates. For foreign IP address data, we use the maxmind open-source project geoip, and the domestic IP data we use pure qqwry, because qqwry is in rara format, first, install unrar in the system.
wget http://www.rarlab.com/rar/unrar-3.7.7-centos.gz
gzip -d unrar-3.7.7-centos.gz
mv unrar-3.7.7-centos /usr/local/bin/
Write the following script to automatically synchronize IP data to the/usr/local/share directory.
VI update_ipdata.sh
#!/bin/bash
if [ ! -d /usr/local/share/GeoIP ] ; then
mkdir /usr/local/share/GeoIP
fi
if [ ! -d /usr/local/share/qqIP ] ; then
mkdir /usr/local/share/qqIP
fi
wget -t 5 -O /tmp/GeoIP.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget -t 5 -O /tmp/GeoLiteCity.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget -t 5 -O /tmp/GeoIPASNum.dat.gz http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
wget -t 5 -O /tmp/qqwry.rar http://update.cz88.net/soft/qqwry.rar
gzip -df /tmp/GeoIP.dat.gz
gzip -df /tmp/GeoLiteCity.dat.gz
gzip -df /tmp/GeoIPASNum.dat.gz
/usr/local/bin/unrar e -nQQWry.Dat -o+ /tmp/qqwry.rar /tmp/
mv -f /tmp/Geo*.dat /usr/local/share/GeoIP/
mv -f /tmp/QQWry.Dat /usr/local/share/qqIP/
We update the IP database at every Wednesday morning:
20 6 *** 3/usr/local/AWStats/update-ipdata-cron.sh
Finally, check the directory configuration, view AWStats. Common. conf, and modify the following three lines:
LoadPlugin="geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat"
LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoIPASNum.dat"
In the AWStats/wwwroot/cgi-bin/Plugins directory, modify qqwry. pl
My $ ipfile = "/qqwry. dat ";
To:
My $ ipfile = "/usr/local/share/qqip/qqwry. dat ";
For more information about how to install geoip, see the AWStats blog of antezenta. For more information about pure database format, see the qqwry format resolution of lumaqq. For PHP parsing QQ format, consider using the PHP extension of qqwry (C code)