我的错误日志包含:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
我替换了 apache 配置文件上的日志级别:
LogLevel debug
重新启动后,我收到相同的错误消息,但没有所谓的“回溯”。据我了解,应该有 mod_rewrite 正则表达式生成的那 10 行重定向。
在互联网上搜索后,我发现了很多关于 loglevel 和 mod_rewrite 的解释,但没有提到如何使 loglevel 调试工作。
有什么想法吗?
最佳答案
请注意,在较新的 Apache 版本中,RewriteLog
和 RewriteLogLevel
已被删除,事实上,现在在尝试启动 Apache 时会触发错误(至少在我的使用 Apache 2.4.2 安装 XAMPP):
AH00526: Syntax error on line xx of path/to/config/file.conf: Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration`
相反,您现在应该使用通用 LogLevel
指令,级别为 trace1
到 trace8
。 “debug”没有在日志中为我显示任何重写消息。
示例:LogLevel warn rewrite:trace3
官方文档,see here .
当然这也意味着现在你的重写日志将被写入通用错误日志文件中,你必须自己整理它们。
关于debugging - 如何在 Apache2 服务器上启用日志级别调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5641618/