I have a problem with a long running CGI and the timeout error:
Timeout waiting for output from CGI script
The client side is a form programmed in jQuery. The user input some data and receives a message that the analyses has been launch. The user don't expect to see receive more messages except an email with a link when the data has been analyzed. So, at this point, the connection with the client is closed, right?
In the server side, a Perl CGI script gets the data and executes some C programs (using Perl's system) to analyze them. This process can take from a few seconds to hours depending on the inputed data.
Then the same CGI program parses the results and sends an email to the user with a link to the results webpage.
Since for some data, the CGI can be running for hours I am getting the error message.
I am assuming that increasing ScriptTimeout is a bad idea. I am not even sure that mod_cgi is installed.
What can I do to avoid this error?
Server: Apache2 running in Mac OS X.