Hi, I've had this strange problem off and on ever since we started using mod_perl. Occasionally, when the page is generated and printed, the output goes to the Apache error log instead of to the client (the client only receives Connection: close).
The site engine is designed in such a way that it can be used both with Apache::PerlRun and with traditional mod_cgi. Under mod_cgi, this strange behavior has never occurred, to my knowledge. The Apache version is 1.3.29.0.2 and the mod_perl version is 1.29.0.2, with perl version 5.8.3. All are from Debian packages, but the Debian maintainer has no clue why this would be happening. Bug link: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=242499 I have attempted to ensure that the output goes to the correct FD by explicitly selecting STDOUT before printing anything to the client; the print statements are also explicitly directed to STDOUT. Unfortunately, this has no effect; randomly, a page load will end up in the error log instead of on the client even though it was printed to STDOUT. It also seems like when STDOUT has died, then STDIN is also dead, like the browser gave up prematurely, because nothing is received as POST data by the script. But it is unlikely to be a browser problem, since I have tried numerous browsers with the same results... Does anyone who is "clued-in" on mod_perl design have a clue what is going on here? Our setup really isn't complex at all. The best hypothesis I can come up with is that stdout is getting prematurely closed somehow inside Apache. I've copied in a vhost snippet for one of the mod_perl sites. I'm not opposed to source level debugging, but I can't spend hours right now digging around in unfamiliar code just to find likely trouble spots. Thanks for any advice! PerlModule Apache::Registry PerlModule Apache::RegistryNG PerlModule Apache::RegistryFilter PerlModule Apache::DBI # PerlModule Apache::Reload PerlModule Apache::StatINC PerlModule Apache::Filter PerlModule Apache::Dynagzip PerlModule Apache::CompressClientFixup PerlModule Apache::SizeLimit PerlModule Apache::SIG PerlModule Apache::RedirectLogFix # PerlModule Apache::PerlVINC PerlWarn on PerlTaintCheck on <Location /perl> DirectoryIndex nph-admin.pl PerlRequire /afs/icequake.net/www/vhost/wixsites/BraShop/Admin/cgi-bin/modperl_prepare.pl PerlSetVar ReloadModules "WixSite::* ABSAdmin::*" # <Limit PUT GET POST> # MaxConcurrentReqs 10 # </Limit> SetHandler perl-script PerlSetVar Filter On PerlSetVar LightCompression On PerlSetVar UseCGIHeadersFromScript On # PerlHandler Apache::RegistryFilter Apache::Dynagzip PerlHandler Apache::RegistryFilter # reload program modules when changed PerlInitHandler Apache::Reload PerlSetVar ReloadAll Off PerlSetVar ReloadDebug Off PerlSetVar ReloadConstantRedefineWarnings Off PerlFixupHandler Apache::SIG Apache::SizeLimit Apache::CompressClientFixup # http://www.macosxhints.com/article.php?story=20031129120521712&mode=print PerlHeaderParserHandler "sub { tie *STDOUT, 'Apache' unless tied *STDOUT; }" # Normal stuff Options ExecCGI allow from all # Emulate nph-*.cgi PerlSendHeader off # Give us %ENV PerlSetupEnv on </Location> -- Ryan Underwood, <[EMAIL PROTECTED]>
signature.asc
Description: Digital signature