Errors for virtual host are not written to specified ErrorLog, but to default error_log

自古美人都是妖i 提交于 2019-12-23 09:55:14

问题


I have upgraded to Apache 2.2.22 on a Debian 7 VM. I have just installed it using apt-get and not made any config changes except to add my 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>

The behavior I was used to was that any Perl errors or warns appeared in the error log specified in the virtual host. The behavior I'm now getting is that the Perl errors go to the common Apache log in /var/log/apache2 directory and the virtual host log just contains "Premature end of script headers".

I've done some googling on this but most of the results are about mod_perl. I did find this page and the last comment suggests that there was a change to how this works but no information was given as to whether it could be changed. Apache Log Forum "Any information written to stderr by a CGI script will be copied directly to the error log."

Is there a way to configure apache to direct Perl errors and warns to the error log specified in virtual host?

The previous Apache version I was using was 2.2.15.


回答1:


This is (was?) a longstanding bug in mod_cgid. Its status still is "RESOLVED LATER" which (apparently) means: "stop complaining - we'll do it in a later version, not now". Maybe it has been solved by now (your version, 2.2.22, is 3 years old), but I couldn't find any mention of it.

mod_cgid is the default .cgi handler in the threaded version of Apache. If you switch to mod_cgi, e.g. by using a non-threaded apache (like I do) that should solve your problem.



来源:https://stackoverflow.com/questions/28450175/errors-for-virtual-host-are-not-written-to-specified-errorlog-but-to-default-er

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!