Awstats服务

部署Awstats统计Http访问日志

1、 解压、安装

[root@localhost ~]# tar -zxf awstats-7.1.tar.gz

[root@localhost ~]# mv awstats-7.1 /usr/local/awstats

2、 为站点建立配置文件

[root@localhost ~]# cd /usr/local/awstats/tools

[root@localhost tools]# ./awstats_configure.pl

……

Config file path ('none' to skip web server setup):

> /etc/http/conf/http.conf

- This file does not exists.

Config file path ('none' to skip web server setup):

> /etc/httpd/conf/httpd.conf                

……

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.tarena.com

3、指定统计的目标日志文件

[root@localhost tools]# vim /etc/awstats/awstats.www.tarena.com.conf

……

51 LogFile="/var/log/httpd/access_log"

…….

[root@localhost tools]# mkdir /var/lib/awstats

4、将日志文件导入Awstats

[root@localhost tools]# ./awstats_updateall.pl now

[root@localhost tools]# crontab -e

*/5 * * * * /usr/local/awstats/tools/awstats_updateall.pl now

[root@localhost tools]# service crond restart

[root@localhost tools]# chkconfig crond on

[root@localhost tools]# cat /var/www/html/awstats.html

<html>

<><html>

<head><meta http-equiv=refresh content="0;  

url=http://www.tarena.com/awstats/awstats.pl?

config=www.tarena.com">

</head>

<body>

</body>

</html>

1、 验证

http://www.tarena.com/awstats.html


你可能感兴趣的:(server,File,统计)