uth5321 发表于 2015-10-19 08:44:24

Apache服务AWStats分析系统


[*]搭建AWStats系统(所用软件awstats-7.0.zip )

解压
unzip awstats-7.0.zip
移动到httpd的安装目录下
mv awstats-7.0 /usr/local/awstats

cd /usr/local/awstats/tools/
chmod +x awstats_configure.pl
./awstats_configure.pl

2.建立统计站点的配置文件
Do you want me to setup Apache to write 'combined' log files ? y选择Y
Do you want me to build a new AWStats config/profile
file (required if first install) ? y   选择Y
Your web site, virtual server or profile name:
> www.localhost.com      输入监听的域名
Directory path to store config file(s) (Enter for default):
>   直接回车

3.修改站点统计配置文件
vim /etc/awstats/awstats.www.localhost.com.conf
51 LogFile="/usr/local/httpd/logs/access_log"
203 DirData="/var/lib/awstats"
mkdir -p /var/lib/awstats

4.执行日志分析 设置cron计划任务
# chmod +x awstats_updateall.pl
# ./awstats_updateall.pl

crontab -e    设置计划任务
*/5 * * * * /usr/local/awstats/tools/awstats_updateall.pl每5分钟执行一次
# /etc/init.d/crond start
# chkconfig --level 35 crond on

5.访问awstats
http://192.168.116.111/awstats/awstats.pl?config=www.localhost.com
没有搭建dns 想通过域名访问
vim /etc/hosts
192.168.116.111   www.localhost.com
或者访问 http://www.localhost.com/awstats/awstats.pl?config=www.localhost.com
访问成功!!!

页: [1]
查看完整版本: Apache服务AWStats分析系统