python - How can I serve unbuffered CGI content from Apache 2? -
I would like to be able to see the output of a long-running GCI script because it is generated instead of the script Since the completion. However, when I explicitly flush STDOUT, the server is waiting for the script before sending the response to the client. It is on a Linux server running Apache 2.2.9.
Example Python CGI:
#! / Usr / bin / python Import time import system print I print for the "content-type: text / plain" category (1, 10): print i sys.stdout.flush () time.sleep (1) print "complete. "
Similar example in Pearl:
#! / Usr / bin / perl print "content-type: text / plain \ n \ n"; ($ I = 1; $ i & lt; = 10; $ i ++) {print "$ i \ n"; Sleep (1); } Print "done.";
This link says as Apache 1.3 1.3 CGI Output should be ineffective (but it can only apply to Apache 1.x):
Any ideas?
Randall Schwartz Articles A Different (and Imho, Improved) Method of Viewing a Long-Term Process telling.
/ div>