awstats分析出国家地区

1.下载安装GeoIP库:
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
gunzip GeoIP.tar.gz
cd  GeoIP-1.4.8/
./configure
make && make install
我到这步报错,然后使用yum来安装
yum install GeoIP GeoIP-devel perl-Geo-IP


2.下载安装Geo-IP-PurePerl
wget http://geolite.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-1.19.tar.gz
gunzip Geo-IP-PurePerl-1.19.tar.gz
cd  Geo-IP-PurePerl-1.19/
perl Makefile.PL LIBS='-L/usr/local/lib'
make && make install


3.下载库 GeoIP免费的是国家/IP的数据表,GeoIPCityLite是地区的数据表
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
下载之后解压到/usr/local/awstats/wwwroot/cgi-bin/目录下


4.修改配置文件
vi /etc/awstats/awstats.www.meihua.info.conf
LoadPlugin="geoip GEOIP_STANDARD /usr/local/awstats/wwwroot/cgi-bin/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/awstats/wwwroot/cgi-bin/GeoLiteCity.dat"
LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /usr/local/awstats/wwwroot/cgi-bin/GeoIPASNum.dat"


5.测试,把生成过的数据文件备份重新生成一次
/usr/local/awstats/wwwroot/cgi-bin/awstats.pl -update -config=www.meihua.info


你可能感兴趣的:(awstats分析国家地区)