I have a default Apache 2.2 system setup with a Perl CGI script directory configured like so:
ScriptAlias /jarvis/ "/opt/jarvis/cgi-bin/"
Nothing fancy in here except one of my scripts takes over 10 minutes to process, and due to various reasons, prints out nothing during this time.
Apache appears to have a timeframe of 10 minutes (600 seconds) for CGI scripts to run - and if no output appears from the script in this timeframe then the script is killed and a 500 response is sent to the browser/client.
[Thu Apr 23 13:57:53 2009] [warn] [client 127.0.0.1] Timeout waiting for output from CGI script /opt/jarvis/cgi-bin/jarvis.pl
appears in the log on one system (Ubuntu, installed via apt-get), but doesn't on another (Windows, installed via package download).
My question is - is there any configuration in Apache 2.2 that would allow me to run a script longer than 10 minutes without it being killed?
Writing log messages out regularly avoids this error - so a log message written every few minutes ensures that long running processes don't get killed. I eventually solved my problem by implementing a progress bar on the client and having my script write a "." every so often to update the bar on the other end.