安装过程中会让你回答下列等问题
Do you want me to setup Apache to write 'combined' log files [y/N] ? y
Do you want me to build a new AWStats config/profile file (required if first install) [y/N] ? y
Your web site, virtual server or profile name:
> www.test.com
Directory path to store config file(s) (Enter for default):
> /usr/local/etc/awstats
安装过程会自动在httpd.conf文件中添加下面的配置信息
Alias /awstatsclasses "/usr/local/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/local/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/local/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/local/awstats/wwwroot/cgi-bin/"
<Directory "/usr/local/awstats/wwwroot">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
需要
GeoIP C Library
Geo::IP Perl Module (faster, but requires C library)
Geo::IP::PurePerl 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
安装Geo::IP::PurePerl Module
# wget http://www.maxmind.com/download/geoip/api/pureperl/Geo-IP-PurePerl-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
设置proftp
更改proftpd.conf文件,添加如下两行
LogFormat awstats "%t %h %u %m %f %s %b"
# 注意:在%号之间必须用tab键作为分隔符,不能用空格键
ExtendedLog /var/log/xferlog read,write awstats
# WARNING: ExtendedLog directive might need to be placed inside a virtual host context if you use them
然后关闭老的日志格式
TransferLog none
# WARNING: TransferLog directive might need to be placed inside a virtual host context if you use them.
想让你的设置生效,先停止proftp服务,删除旧的日志文件/var/log/xferlog,然后启动proftp服务。登陆ftp,下载一个文件,你的新日志文件会有新的一行,类似如下这个样子:
[01/Jan/2001:21:49:57 +0200] ftp.server.com user RETR /home/fileiget.txt 226 1499
适用于Postfix, Sendmail, QMail
复制配置文件awstats.model.conf到/usr/local/etc/awstats目录下,并把文件名改成awstats.mail.conf,修改这个新的配置文件
# mkdir -p /usr/local/share/awstats/mail
# cp /usr/local/awstats/wwwroot/cgi-bin/awstats.model.conf /usr/local/etc/awstats/awstats.mail.conf
# vi /usr/local/etc/awstats/awstats.mail.conf
For standard Postfix, Sendmail, MDaemon and standard QMail logfiles, set
LogFile="perl /usr/local/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"
If the logfiles are compressed, they can be processed this way
LogFile="gzip -cd /var/log/maillog.0.gz | /usr/local/awstats/tools/maillogconvert.pl standard |"
And for VAdmin QMail logfiles (multi-host/virtualhost mail servers running vadmin software), set
LogFile="perl /usr/local/awstats/tools/maillogconvert.pl vadmin < /var/log/maillog |"
Then, whatever is you mail server, you must also change:
LogType=M
LogFormat="%time2 %email %email_r %host %host_r %method %url %code %bytesd"
SiteDomain="mail.test.com"
HostAliases="mail.test.com 192.168.0.3"
DirData="/usr/local/share/awstats/mail"
LevelForBrowsersDetection=0
LevelForOSDetection=0
LevelForRefererAnalyze=0
LevelForRobotsDetection=0
LevelForWormsDetection=0
LevelForSearchEnginesDetection=0
LevelForFileTypesDetection=0
ShowMenu=1
ShowSummary=HB
ShowMonthStats=HB
ShowDaysOfMonthStats=HB
ShowDaysOfWeekStats=HB
ShowHoursStats=HB
ShowDomainsStats=0
ShowHostsStats=HBL
ShowAuthenticatedUsers=0
ShowRobotsStats=0
ShowEMailSenders=HBML
ShowEMailReceivers=HBML
ShowSessionsStats=0
ShowPagesStats=0
ShowFileTypesStats=0
ShowFileSizesStats=0
ShowBrowsersStats=0
ShowOSStats=0
ShowOriginStats=0
ShowKeyphrasesStats=0
ShowKeywordsStats=0
ShowMiscStats=0
ShowHTTPErrorsStats=0
ShowSMTPErrorsStats=1