看了车东关于AWStats分析Apache日志的文章:http://www.chedong.com/tech/awstats.html,最令人感兴趣的就是可以使用一个简单的工具cronolog来自动分割Apache日志,然后使用AWStats定时更新工具自动更新一定日期格式的日志文件,生成静态页面。我的系统为WindowsXP,总结步骤如下:
1.下载cronolog的win32 version,我下的是唯一一个win32版v1.6.2,解压后将cronolog.exe复制到Apache的bin目录下:C:\Program Files\Apache Group\Apache\bin\cronolog.exe。
2.编辑Apache的httpd.conf,将
修改为
3.设置AWStats中相应站点的配置文件,使用前一天的日志文件更新AWStats数据:
4.输出。动态页面的话就是http://logs.xdanger.com/cgi-bin/awstats.pl?config=blog.xdanger.com。静态的话还需要AWStats下载包里的一个额外工具tools/awstats_buildstaticpages.pl
D:\sites\xdanger.com\logs\cgi-bin\tools\awstats_buildstaticpages.pl -update -config=blog.xdanger.com -lang=cn -dir=d:\sites\xdanger.com\logs\blog.xdanger.com.html -awstatsprog=D:\sites\xdanger.com\logs\cgi-bin\awstats.pl
但是第二步重起Apache后该log文件并没建立,日志也没有记录,不知道为什么……
如果有人在win32下用过conolog的话,请一定联系我告诉我哪里出错了,万分感谢。
官方原始的INSTALL文档如下:
Basic Installation
==================
Important note:
You need the apache version 1.3.13-dev as minimum. The
support of
piped call of external programs appears in this version the
first
time. All prior version can not spawn the cronolog process.
You need to copy the cronolog.exe to a directory. The best place is
your
apache bin directory. Then you can configure the apache server
configuration
file to use convlog for dynamic log file splitting.
Configuration for use with NT service:
TransferLog
"|c:/apache/bin/convlog.exe c:/apache/logs/access%Y%m%d.log"
Configuration for use from command line:
TransferLog
"|c:/apache/bin/convlog.exe c:/apache/logs/access%%Y%%m%%d.log"
I do not know why the command line version requires different
parameters.
I filled a big report at the apache bug database.
The configuration of cronolog for windows supports ONLY the
short
configuration options. I did not found a getopt_long()
function
equivalent for windows. Please mail me if you find it.
Klaus Mueller
k.mueller@intershop.de