English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to set up two webservers that will allow a CGI script (perl based ) to run for hours. Apache gives me timeout errors right now.

thanks!

2007-09-22 10:42:27 · 4 answers · asked by Mark B 1 in Computers & Internet Programming & Design

4 answers

The timeout is to protect the system from runaway applications.

For something that long, as a system admin, I would take the CGI outside of the apache-web territory. Have the CGI write the info to a file and just kick back a screen saying "it will be processed", then let that session die. You dont really have anyone waiting that long for the results do you?

Then have a server application pick it up from the request file, process it, and write a result page to a web location that the requester can return to in order to see the results.

If you do need the original requester to see only their results then have the original CGI create a temporary file name and tell the requester on the "will be processed page". Save that file name to the requester file and have the processing application use it when creating the output.

2007-09-23 04:11:36 · answer #1 · answered by Gandalf Parker 7 · 0 0

You can set the timeout limit in the Apache server configuration. This would go within the CGI directive. The current default is 300 (seconds.)

2007-09-22 10:54:50 · answer #2 · answered by BigRez 6 · 0 0

You can play with timeouts all you like... none will guarantee staying connected for long periods!

start with a cgi that forks off a task to do the work,

and a second cgi to check to see if it's done.

`longRunningProgram.pl &` is the simplest way.

2007-09-22 10:58:56 · answer #3 · answered by jake cigar™ is retired 7 · 2 0

In httpd.conf, set the TimeOut to a big number. Works for me, I have a webservice that takes several minutes to complete.

2007-09-23 03:03:45 · answer #4 · answered by martinthurn 6 · 0 0

fedest.com, questions and answers