1.确认apache已经安装:
netstat -utpln |grep 80
2.下载与解压:
tar zxvf awstats-7.3.tar.gz
mv awstats-7.3 /usr/local/awstats
3.配置awstats:
cd /usr/local/awstats/tools
chmod +x ./*
./awstats_configure.pl
#####开始配置###
a.当提示输入httpd.conf时输入并回车继续:
/usr/local/httpd/conf/httpd.conf
b.其他提示输入:y回车继续
c.当提示配置文件名称时,输入:
http://www.gxfc.com
####配置结束###
4.修改awstats配置文件:
vim /etc/awstats/awstats.http://www.gxfc.com.conf
LogFile="/usr/local/httpd/logs/access_log" ##修改第 50 行
:wq
mkdir /var/lib/awstats
5.设置计划任务并重启服务器:
echo "*/5 * * * * /usr/local/awstats/tools/awstats_updateall.pl now" >/var/spool/cron/root ##每个5分更新一次
/usr/local/awstats/tools/awstats_updateall.pl now ##执行首次更新
/usr/local/httpd/bin/apachectl restart
netstat -utpln |grep 80
/etc/init.d/crond restart
crontab -l
chkconfig crond on
6.访问测试:
http://http://www.gxfc.com/awstats/awstats.pl?config=http://www.gxfc.com
编写简化页面:
vim /usr/local/httpd/htdocs/aws.html
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://http://www.gxfc.com/awstats/awstats.pl?config=http://www.gxfc.com" />
</head>
<body></body>
</html>
:wq
访问:
http://http://www.gxfc.com/aws.html