一. awstats基本安装 cd /usr/local/
wget http://jaist.dl.sourceforge.net/ ... /awstats-6.7.tar.gz
tar zxvf awstats-6.7.tar.gz
mv awstats-6.7 awstats
cd tools/
复制代码
./awstats_configure.pl 按提示操作生成配置文件存放在/etc/awstats
cd /usr/local/awstats/wwwroot/cgi-bin/
cp awstats.model.conf /etc/awstats/
cd /etc/awstats/
mv awstats.model.conf common.conf
#vi awstats.bbs.linuxtone.org.conf
Include "common.conf"
LogFile="/data/logs/access_bbs.linuxtone.org.%YYYY-24%MM-24%DD-24"
LogType=W
SiteDomain="bbs.linuxtone.org"
HostAliases="www.linuxtone.org"
DefaultFile="index.html index.php"
DirData="/data/www/wwwroot/tongji/statics"
DirIcons="/icons"
AllowToUpdateStatsFromBrowser=1
复制代码
二.插件安装 http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.3.tar.gz http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.28.tar.gz
这两个是一组,必须先编译安装C的,再编译安装perl的
安装GeoIP
需要 GeoIP C Library
Geo::IP Perl Module (faster, but requires C library)
Geo::IP:urePerl Module (slower, but does not require C library)
C Library和Perl Module是一组,必须先编译安装C的,再编译安装perl,或者直接装PurePerl Module,我就是这种方式
复制代码
安装GeoIP C Library # wget http://www.maxmind.com/download/geoip/api/c/GeoIP-1.3.8.tar.gz
# tar zxvf GeoIP-1.3.8.tar.gz
# cd GeoIP-1.3.8
# ./configure; make; make install
复制代码
安装 Geo::IP Perl Module
# wget http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.25.tar.gz
# tar zxvf Geo-IP-1.25.tar.gz
# cd Geo-IP-1.25
# perl Makefile.PL
# make
# make test (在AS4下通不过,放弃,改装PurePerl Module)
# make install[/code]
以上两步也可以这样安装 # perl -MCPAN -e shell
cpan> install Geo::IP
复制代码
安装Geo::IP::PurePerl Module # wget http://www.maxmind.com/download/ ... urePerl-1.14.tar.gz
# tar zxvf Geo-IP-PurePerl-1.14.tar.gz
# cd Geo-IP-PurePerl-1.14
# perl Makefile.PL
# make
# make test
# make install
也可以这样安装
# perl -MCPAN -e shell
cpan> install Geo::IP:urePerl
修改/usr/local/etc/awstats/awstats.www.test.com.conf,取消下面这行的注释,启用此插件
LoadPlugin="geoip GEOIP_STANDARD"
复制代码
更新GeoIP库 # cd /usr/local/share/GeoIP/
# wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
# gunzip GeoIP.dat.gz
复制代码
定时更新GeoIP库
0 0 * * * root /usr/local/bin/geoipupdate -v