【原创】日志分析工具:awstats配置使用说明

 

      awstats安装配置步骤:

      环境:

      服务器:windows2003

      WEB服务器:apache2.2

 

      步骤:

      1、安装cronolog:其作用是把日志按日期生成,如access_101026.log,下载cronolog

      2、安装ActivePerl:是Perl的解析器,因为awstats主要是perl写的系统,所以必须有perl解析器才能运行,安装ActivePerl是安装awstats的先决条件,下载ActivePerl

      3、安装配置awstats:awstats是主要系统日志的主要分析工具,是这篇文章的主角,下载awstats

      4、注意事项。

****************************************************************************************

      1 安装cronolog

        下载后的cronolog.exe直接复制粘贴到apache2.2/bin目录下,然后修改apache的httpd.conf配置文档。

        找到CustomLog "logs/access.log" common,需要修改成:

        CustomLog "|bin/cronolog.exe logs/access_%y%m%d.log" combined env=!image-request

        保存,关闭httpd.conf文件。

      2 安装ActivePerl

        双击安装文件ActivePerl-5.12.2.1202-MSWin32-x86-293621.msi,安装到自己想要安装的目录,我选择的是E:/ActivePerl;

      3 安装配置awstats

        双击安装文件awstats-6.95.exe,选择自己的安装路径,我选择的是E:/awstats,这里需要注意的是安装的文件夹名字,最好不要带空格“ ”,不然在NT系统下会很麻烦,提示你找不到某个文件,如Program files,这个文件中多了个空格,那么在最后更新awstats的时候会提示你Prgram 文件找不到或打不开。

       在安装awstats快结束的时候,awstats会启用自己的配置工具,自身带的perl写的一个配置工具,这个只要按照里面的说明填写自己web服务信息就可以了。

       注意:1)要你给你要分析的日志起名字,如demo

           2)填写web服务信息的时候,会提示是否覆盖httpd.conf文件,你要选择y,这样就直接自动生成了httpd.conf文件而不用在按照awstats官方里面说的手动修改httpd.conf文件了。

 

      配置awstats.model.conf、awstats.demo.conf:

                 1)在awstats.model.conf里查找 Logfile 字符串,修改为:

                  LogFile="E:/Program Files/Apache Software Foundation/Apache2.2/logs/access_%YYYY-24%MM-24�-24.log"

                2)打开awstats.demo.conf,这里的awstats.demo.conf文档是你在安装awstats最后配置的时候写的分析文件名:你写的sitname是demo,生成的就是awstats.demo.conf。

                    查找LoadPlugin="decodeutfkeys" ,去掉前面的#为:

                   LoadPlugin="decodeutfkeys" 

          

        写到这里,基本上awstats就配置完成了,最后一个步骤:跟新awstats。

        “开始”--->“运行”--->“cmd”启动DOS工具,跳转目录到你的perl安装目录,找的perl.exe文件,进行最后的更新工作。

        E:/Perl/bin>perl E:/AWStats/wwwroot/cgi-bin/awredir.pl - update -config=demo
----- awredir 1.2 (build 1.12) (c) Laurent Destailleur -----
This script is absolutely not required to use AWStats.
It's a third tool that can help webmaster in their tracking tasks but is
not used by AWStats engine.

This tools must be used as a CGI script. When called as a CGI, it returns to
browser a redirector to tell it to show the page provided in 'url' parameter.
So, to use this script, you must replace HTML code for external links onto your
HTML pages from
<a href="Linkhttp://externalsite/pagelinked">Link</a>
to
<a href="http://mysite/cgi-bin/awredir.pl?key=ABCDEFGH&url=http://externalsite/page
nked">Link</a>

For your web visitor, there is no difference. However this allow you to track
clicks done on links onto your web pages that point to external web sites,
because an entry will be seen in your own server log, to awredir.pl script
with url parameter, even if link was pointing to another external web server.

*************************************************************************************

               

              好了,到这里我们的安装配置工作已经完成,让我们来看看安装的结果怎么样。打开浏览器,输入

http://localhost/awstats/awstats.pl?config=demo,提示的是:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
......

 

          漠然,怎么回事呢,查找资料及error_log日志,才发现awstats.pl文件里面第一行#!/usr/bin/perl,这个是明显的错误,因为perl的目录不在这里,修改为:#!E:/Perl/bin/perl.exe

           在次刷新http://localhost/awstats/awstats.pl?config=demo这次可以正常查看了,上图:

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值