安装Awstats

1)安装AWstats软件包
解压包:tar zxf awstats-7.3.tar.gz -C /usr/src
2)修改路径
mv awstats-7.3  /usr/local/swstats/
3)为要统计的站点建立配置文件
AWSuats 系统支持统计多个网站的日志文件,通常以网站名称来区分不同的站点,因此,在
执行日志文件分析之前 需要为每个Web站点建立站点统计配置文件, 借助于AWSsats 系统提供
的awstars_configure_ pl 脚本可以简化创建过程,
首先切换到awstats/tools目录下,并执行其中的awstats. contigure.pi 脚本,
cd /usr/local/awstats/tools/
chmod +x awstats_configure.pl(给脚本执行权限)
./awstats_configure.pl    (执行脚本)
之后将会进入一个交互式的配置过程(将会检查awstats的安装目、httpd服务的配置文件
路径,日志记录格式等系统环境,并提示用户指定站点名称、设置配置文件路径。、
一次输入
yes
>/usr/local/httpd/conf/httpd.conf  (httpd.conf的配置文件路径)
yes
yes
>www.xinlang.com    (指定要统计的目标网站名称)
回车(接受默认设置)
4)修改站点统计配置文件(主要是一指定要分析的weblogfile和指定用来存放统计数据的目录)
vim /etc/awstats/swstats.www.xinlang.com.conf
在LogFile=“/usr/local/httpd/logs/access_log”(指定访问日志路径)
5)mkdir /var/lib/awstats (DirData用来指定数据目录)
6)执行日志分析,并设置crontab
chmod +x awstats_updateall.pl
./awstats_updateall.pl now   (更新所有站点)
设置计划任务
crontab -e
*****  /usr/local/awstats/tools/awstats_updateall.pl now
/etc/init.d/crond start  (启动crond)
chkconfig --level 35 crond on (crond在35级别启动)
7)优化访问路径
vim  /usr/local/httpd/htdocs/awstats.html

猜你喜欢

转载自blog.csdn.net/bpb_cx/article/details/80977496