-
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
-
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz ==>> 没能生效
-
wget http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
-
-
mkdir /var/GeoIP
-
mv GeoIP.dat.gz /var/GeoIP/
-
gunzip /var/GeoIP/GeoIP.dat.gz
-
mv GeoLiteCity.dat.gz /var/GeoIP/
-
gunzip /var/GeoIP/GeoLiteCity.dat.gz
-
mv GeoIPASNum.dat.gz /var/GeoIP/
-
gunzip /var/GeoIP/GeoIPASNum.dat.gz
-
-
yum install libtool
-
#先下载安装C库
-
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP-1.4.8.tar.gz
-
tar -zxf GeoIP-1.4.8.tar.gz
-
cd GeoIP-1.4.8/
-
./configure
-
make && make install
-
-
#下载Perl库
-
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.40.tar.gz
-
tar -zxf Geo-IP-1.40.tar.gz
-
cd Geo-IP-1.40/
-
perl Makefile.PL
-
make && make install
-
-
perl -MCPAN -e 'install "Geo::IP"'
-
perl -MCPAN -e 'install "Geo::IPfree"'
-
-
vim /etc/awstats/awstats.common.conf
-
-
#1422 行左右添加:
-
LoadPlugin="geoip GEOIP_STANDARD /var/GeoIP/GeoIP.dat"
-
-
#1432 行左右添加:
-
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /var/GeoIP/GeoLiteCity.dat"
-
-
#1469 行左右添加:
-
LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /var/GeoIP/GeoIPASNum.dat"
-
-
rm -rf /var/lib/awstats/* #删除旧的统计数据
-
/usr/local/awstats/tools/awstats_updateall.pl now
-
/usr/local/awstats/tools/awstats_buildstaticpages.pl -update -config=website -lang=cn -dir=/path_of_your_website/awstats/website