1、安装awstats软件包
mount /dev/cdrom /media
cp /media/chapter05/awstats-7.0.zip /usr/src
cd /usr/src
unzip awstats-z.0.zip
mv awstats-7.0 /usr/local/awstats
2、为要统计的站点建立配置文件
cd /usr/local/awstats/tools
./awstats_configure.pl
1)指定httpd主配置文件的路径
2)设置日志类型
3)为指定WEB站点创建配置文件
rpm -e --nodeps httpd
/usr/local/httpd/bin/apachectl restart
3、修改站点统计配置文件
vim /etc/awstats/awstats.www.benet.com.conf
LogFile="/usr/local/httpd/logs/access_log"(指明网站日志文件路径)
DirData="/var/lib/awstats"
4、执行日志分析,并设置cron计划任务
mkdir /var/lib/awstats
/usr/local/awstats/tools/awstats_updateall.pl now(执行日志分析)
crontab -e(设置cron计划任务)
*/5 * * * * /usr/local/awstats/tools/awstats_updateall.pl now
/etc/init.d/crond start
chkconfig --level 35 crond on
5、访问AWSTATS分析系统
http://10.0.0.1/awstats/awstats.pl?config=www.benet.com
如果看不到统计信息:
/usr/local/httpd/bin/apachectl restart
/usr/local/awstats/tools/awstats_updateall.pl now
6、简化url
vim /usr/local/httpd/htdocs/awb.html
<html>
<head>
<meta http-equiv=refresh content="0;
url=http://10.0.0.1/awstats/awstats.pl?config=www.benet.com">
</head>
<body></body>
</html>
转载于:https://blog.51cto.com/miaoyuanqiang/1639819