FCGI app reloading on every request
John Nagle
nagle at animats.com
Tue Sep 4 14:31:50 EDT 2007
Thorsten Kampe wrote:
> * John Nagle (Mon, 03 Sep 2007 21:26:01 -0700)
>
>> I'm converting a web app from CGI to FCGI. The application works fine
>>under FCGI, but it's being reloaded for every request, which makes FCGI
>>kind of pointless. I wrote a little FCGI app which prints when the program is
>>loaded and when it gets a request. And indeed, the program gets reloaded for
>>each HTTP request. Something is probably misconfigured. But what?
>>[...]
>>On the Python side, I'm using Python 2.5 on Linux, with Alan
>>Saddi's "fcgi.py" module.
>
>
> Do you use fcgi.py or flup? Go for flup
I think that's irrelevant. The Python app is being launched in
CGI mode, indicating trouble on the Apache side.
Anything executable in the
cgi-bin directory is being launched as a CGI program. A file
named "example.foo", if executable, will launch as a CGI program.
Nothing launches with FCGI.
Tried putting this in the .htaccess file:
<Files *.fcgi>
SetHandler fcgid-script
Options ExecCGI
allow from all
</Files>
<Files *.foo>
ErrorDocument 403 "File type not supported."
</Files>
Even with that, a ".foo" file gets executed as a CGI script,
and so does a ".fcgi" file. It's an Apache configuration problem.
John Nagle
More information about the Python-list
mailing list