httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <>
Subject Re: Scripts generating 4069+ bytes of STDERR logs jam Apache 2.0.45
Date Wed, 23 Apr 2003 14:45:17 GMT
Sander Smeenk wrote:

> I'm using Apache 2.0.45 (mpm-prefork). Recently I discovered that Apache2
> doesn't like it very much when a CGI-script that it runs, generates
> about 4K of debug data.

yep, known problem

it will also stall if your cgi tries to write more than 4K of output 
(stdout or stderr) before reading all of the request body (e.g., post data)

(replace 4K in my text and yours with your kernel's pipe buffer size)

I have hacked up^H^H^H^H^H^H^H^H^Hheavily revised mod_cgi to handle a 
CGI's stdin/stdout/stderr "properly".  With this change it no longer 
matters in which order your script chooses to do I/O on 
stdin/stdout/stderr.  But

a) it currently buffers the entire reponse for non-nph scripts since I 
haven't yet taught it when to process the script headers
b) other changes are not completely tested
c) no support yet for weenie operating systems like Win32 where APR 
can't poll on pipes
d) because it doesn't alter the filter API or make funny things happen 
in the filter support code, but instead uses normal multi-plexed I/O 
idioms directly in mod_cgi, I'm afraid some people might not like my 

You're free to play with it if you want.

> <offtopic>
> Is there any way to have Apache2 error.log's in simple format?
> I only want the errors, not prefixed with date, time, type and client,
> and postfixed with a referrer URL. I couldn't find anything yet.
> It's really hard to read script debug information now ;)
> </offtopic>

ErrorLog |/path/to/user/provided/reformatter

Reformat it to your heart's desire.

View raw message