You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Colin Campbell <Co...@asidua.com> on 2015/02/13 11:54:22 UTC

[users@httpd] Perl Logging

Hi,

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<http://httpd.apache.org/docs/2.2/logs.html> "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.



Regards

Colin


RE: [users@httpd] Perl Logging

Posted by Colin Campbell <Co...@asidua.com>.
Hi Pete,

Thanks for the reply.  I looked into it and have found the correct package to install on Debian apache2-mpm-prefork.  I checked the old server and it was using the prefork mpm as well.  It was also pointed out that version of apache is 3 years old.  I attempted to build from source but didn't get very far so abandoned that idea.  It's behaving as I'm used to now and as it's for a development box that will see small amounts of traffic I think it will do what I need it to.  Thanks for your help.

Regards

Colin

-----Original Message-----
From: Pete Houston [mailto:ph1@openstrike.co.uk] 
Sent: 16 February 2015 11:45
To: users@httpd.apache.org
Subject: Re: [users@httpd] Perl Logging

Hello Colin,

On Fri, Feb 13, 2015 at 10:54:22AM +0000, Colin Campbell wrote:
> 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
> 
[...]
> 
> 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".

The behaviour you are describing is the standard behaviour with mod_cgid. My guess is that when you performed the upgrade you moved from a prefork MPM to a threaded MPM and therefore by default from mod_cgi to mod_cgid.

There is not, to my knowledge, any simple way of over-riding this logging behaviour within mod_cgid. However, the benefits of a threaded MPM often outweigh this drawback. If you decide that you would prefer to return to a prefork MPM you should check with your distro as to the recommended way to achieve that. I do not use Debian 7 so cannot advise on that score.

Good luck,

Pete
--
Openstrike - improving business through open source http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Perl Logging

Posted by Pete Houston <ph...@openstrike.co.uk>.
Hello Colin,

On Fri, Feb 13, 2015 at 10:54:22AM +0000, Colin Campbell wrote:
> 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
> 
[...]
> 
> 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".

The behaviour you are describing is the standard behaviour with
mod_cgid. My guess is that when you performed the upgrade you moved from
a prefork MPM to a threaded MPM and therefore by default from mod_cgi
to mod_cgid.

There is not, to my knowledge, any simple way of over-riding this logging
behaviour within mod_cgid. However, the benefits of a threaded MPM
often outweigh this drawback. If you decide that you would prefer to
return to a prefork MPM you should check with your distro as to the
recommended way to achieve that. I do not use Debian 7 so cannot advise
on that score.

Good luck,

Pete
-- 
Openstrike - improving business through open source
http://www.openstrike.co.uk/ or call 01722 770036 / 07092 020107