寻觅生命中的那一片浅草......

转载:在windows中安装awstats分析apache日志的问题

在windows中安装awstats分析apache日志的问题

关键字: 日志 awstats apache
在装完apache、activeperl、awstats,并完成所有配置后,写了个bat文件来执行分析,在我设定的data目录里awstats也产生了正确的日志数据文件,但是在用http://localhost/awstats/awstats.pl?config=localhost访问前台界面时,却出现:

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


查看apache的error.log,看见:

[Sat Sep 01 09:46:25 2007] [error] [client 127.0.0.1] (OS 3)系统找不到指定的路径。  : couldn’t create child process: 720003: awstats.pl

很明显是perl.exe执行文件没找到,用editplus打开awstats.pl,看见第一行是:

#!/usr/bin/perl

问题就在这里了,这是默认的perl安装路径,不符合我的实际情况,改为:

#!c:\perl\bin\perl.exe

再访问:http://localhost/awstats/awstats.pl?config=localhost

一切OK.

顺便提一下我没用cronolog轮循apache的日志,而是利用apache自带的rotatelogs工具,具体设置就是把httpd.conf中的:CustomLog logs/access.log common替换为CustomLog “|bin/rotatelogs.exe -l logs/access%Y-%m-%d.log 86400” combined,这样就会生成如access2007-09-01.log的日志文件。

原文出处:http://mayer.javaeye.com/blog/119168
作者:Mayer

尚无评论

发表评论

2024年三月
« 5月    
 123
45678910
11121314151617
18192021222324
25262728293031