1.确认apache已经安装:

netstat -utpln |grep 80

2.下载与解压:

lftp ftp.linuxyy.cn-->cd tools-->get awstats-7.3.tar.gz

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.当提示配置文件名称时,输入:

www.linuxyy.cn

####配置结束###

4.修改awstats配置文件:

vim /etc/awstats/awstats.www.linuxyy.cn.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://www.linuxyy.cn/awstats/awstats.pl?config=www.linuxyy.cn

编写简化页面:

vim /usr/local/httpd/htdocs/aws.html

<html>

  <head>

    <meta http-equiv="refresh" content="0; url=http://www.linuxyy.cn/awstats/awstats.pl?config=www.linuxyy.cn" />

  </head>

  <body></body>

</html>

:wq

访问:

http://www.linuxyy.cn/aws.html