虚拟主机的错误不会写入指定的ErrorLog,而是写入默认的error_log

Yok*_*all 5 apache perl error-logging

我已经在Debian 7 VM上升级到Apache 2.2.22.我刚刚使用apt-get安装它,除了添加我的VirtualHost之外没有进行任何配置更改

<VirtualHost *:8001 *:80>
    ServerName devintegration.ie
    ServerAlias devintegration.ie
    DocumentRoot /sites/integration/development/docs
    ScriptAlias /console/ /sites/integration/development/console/
    ErrorLog /sites/logs/devintegration.ie-error_log
    CustomLog /sites/logs/devintegration.ie-access_log common
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

我习惯的行为是在虚拟主机中指定的错误日志中出现任何Perl错误或警告.我现在得到的行为是Perl错误转到/ var/log/apache2目录中的常见Apache日志,而虚拟主机日志只包含"脚本标题的过早结束".

我已经做了一些谷歌搜索,但大多数结果是关于mod_perl.我确实找到了这个页面,最后的评论表明它的工作方式发生了变化,但没有提供关于是否可以更改的信息. Apache Log Forum "通过CGI脚本写入stderr的任何信息都将直接复制到错误日志中."

有没有办法配置apache来引导Perl错误并警告虚拟主机中指定的错误日志?

我之前使用的Apache版本是2.2.15.

Han*_*Lub 2

这是(曾经是?)中长期存在的错误mod_cgid。它的状态仍然是“稍后解决”,这(显然)意味着:“停止抱怨 - 我们将在以后的版本中做到这一点,而不是现在”。也许现在已经解决了(你的版本2.2.22,已经有3年了),但我找不到任何提及它的内容。

mod_cgid.cgiApache 线程版本中的默认处理程序。如果你切换到mod_cgi,例如使用非线程apache(就像我一样),应该可以解决你的问题。