Advanced Web Statistics 应用

| No Comments | No TrackBacks

当前的Advanced Web Statistics版本是6.4 (build 1.814),为稳定版。
在使用Windows 的 IIS 网站log文件时,有时已经有几个月的log文件了,那么怎样对这些历史纪录作统计呢?

比如配置文件是awstats.test.conf,一般的设置是
logfile = "c:\winnt\system32\logfiles\w3svc1\ex%YY-24%MM-24%DD-24.log"
这是表示对前一天的log文件作统计。

对于历史纪录,要首先在Awstats的压缩包里找到一个文件,logresolvemerge.pl,放到cgi-bin目录下,然后改设置为:
logfile = "c:\wwwroot\site1\cgi-bin\logresolvemerge.pl c:\winnt\system32\logfiles\w3svc1\ex*.log |"
之后在命令行模式下,执行
awstats.pl -config=test - update
所有在上面文件夹里的log文件都会被遍历一遍。
作完这一步之后,再把logfile的配置改回之前的设置。

对于在Windows 的 IIS 服务器,相关的配置还有以下几点要注意:

1)LogFormat
这个的用法在同官方网站的说法不同,更简单,只要打开任意一个log文件。
文件中,第一行是服务器信息
#Software: Microsoft Internet Information Services 5.0
第二行是版本信息
#Version: 1.0
第三行是日期时间
#Date: 2005-11-22 18:27:23
第四行就是我们要的格式
#Fields: date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer)
复制这行的内容,取自#Fields:之后的内容,加上双引号,放在logformat之后就可以了。
LogFormat = "date time c-ip cs-username s-sitename s-computername s-ip s-port cs-method cs-uri-stem cs-uri-query sc-status sc-win32-status sc-bytes cs-bytes time-taken cs-version cs-host cs(User-Agent) cs(Cookie) cs(Referer)"
当然,这样做的前提是服务器的log格式中间没有改动过,


2)SiteDomain
这个参数默认是空的,必须填写,否则不会运行。

3)DirData
这是Awstats存放自己所生成的数据文件的地方,如
DirData="c:\wwwroot\awstats\data\awstlogs"
记得重要的一点是这个文件夹,Internet 用户要有可写的权利。

4)在Plugins段落里
如果你的网页的编码是utf8的话,记得去除下面一行前面的#
#LoadPlugin="decodeutfkeys"
这样在统计分析中的Search Keyphrases和Search Keywords就不会有乱码了。


作者: David Yin
原载: FreeThinking
版权所有。转载时必须以链接形式注明作者和及本声明。

No TrackBacks

TrackBack URL: http://www.yinfor.com/mtcgi/mt-t-1010.cgi/788

Leave a comment

About this Entry

This page contains a single entry by David Yin published on 2005年11月29日 11:03.

西红柿烧牛肉 was the previous entry in this blog.

不可替代的位置 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Archives

Online Tools

Code Convertor
GeoURL
Listed on BlogShares