无法配置重写日志 [英] Can't configure the rewrite log
问题描述
我想启用重写日志来调试是给我的问题有些重写规则。所以我加了这些线在结束我的的httpd.conf 文件:
I'd like to enable the rewrite log to debug some rewrite rules that are giving me problems. So I added these lines at the end of my httpd.conf file:
<IfModule mod_rewrite.c>
RewriteLog "/logs/rewrite.log"
RewriteLogLevel 4
</IfModule>
我做了
接下来的事情是重新启动Apache。它会导致错误然而,也不会启动。这是我的XAMPP控制面板中获得:
Next thing I did was restart Apache. It causes an error however, and won't start. This is what I get in the XAMPP Control Panel:
13:14:56 [Apache] Error: Apache shutdown unexpectedly.
13:14:56 [Apache] This may be due to a blocked port, missing dependencies,
13:14:56 [Apache] improper privileges, a crash, or a shutdown by another method.
13:14:56 [Apache] Check the "/xampp/apache/logs/error.log" file
13:14:56 [Apache] and the Windows Event Viewer for more clues
我没有得到任何线索 error.log中虽然。事实上,当出现这种错误不会产生一行。
I don't get any clue in error.log though. In fact no line is generated when this error occurs.
我也试图改变RewriteLog线使用绝对路径:
I also tried changing the RewriteLog line to use an absolute path:
RewriteLog "c:\xampp\apache\logs\rewrite.log"
您能帮我吗?
推荐答案
哪个版本的Apache?
Which version of Apache?
在2.4,RewriteLog *指令不会了,因为记录已被重写存在。在这种情况下,你应该追加 mod_rewrite.c:TRACE3
你的的LogLevel
行,其中traceX是详细级别( 8> = x> = 1)。输出将被写入到Apache标准错误日志(错误日志
)。
In 2.4, RewriteLog* directives don't exist anymore as logging has been rewritten. In this case, you should append mod_rewrite.c:trace3
to your LogLevel
line where traceX is the level of verbosity (8 >= X >= 1). The output will be written to Apache standard error log (ErrorLog
).
你能不能也运行这些命令:的httpd -t
(语法检查),那么的httpd -w
(运行Apache,但持有打开控制台,用来作为标准错误)
Could you also run these commands:
httpd -t
(syntax checking) then httpd -w
(run Apache but hold open the console, used as stderr)
这篇关于无法配置重写日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!