Apache2.4.x with mod_proxy_fcgi results in an infinite loop within fcl-web fcgi handling
Original Reporter info from Mantis: bobo
-
Reporter name: Attila Borka
Original Reporter info from Mantis: bobo
- Reporter name: Attila Borka
Description:
The new "mod_proxy_fcgi" since Apache httpd 2.3.x is one way to replace the no-longer-maintained 3rd party "mod_fastcgi" in order to do web development with external FCGI applications.
However, unlike the earlier methods, "mod_proxy_fcgi" sends HTTP_CONNECTION -> "keep-alive" which causes fcl-web to enter into an infinite loop in the
TFCgiHandler.WaitForRequest function preventing of the handling of any requests after the first one is finished.
Steps to reproduce:
Apache 2.4.x
apache config:
===========
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
<IfModule mod_proxy_fcgi.c>
#No PATH_INFO with mod_proxy_fcgi unless this is set
SetEnvIf Request_URI . proxy-fcgi-pathinfo=1
#Alias for the long FCGI executable path and program name
Alias /something "..path_to_fcgi_application../fcgiapp_executable"
#mod_proxy_fcgi to call our FCGI executable already listening (like FastCgiExternalServer for mod_fastcgi) on port 2015
ProxyPass "/something" fcgi://127.0.0.1:2015/ connectiontimeout=5 timeout=15
</IfModule>
============
As with FastCgiExternalServer, the FCGI application must be running and listening on the given port in order to receive the requests from the web server.
Additional information:
One solution might be to forcefully close the connection after one request is fully handled (which requires multiple communications between the FCGI application and the web server) and not keep it open after the response is sent.
Mantis conversion info:
- Mantis ID: 23386
- OS: All
- OS Build: All
- Build: latest
- Platform: All
- Version: 2.7.1
- Fixed in version: 2.6.4
- Fixed in revision: 24544 (#1895259c)
- Monitored by: » luizamerico (Luiz Americo)
- Target version: 2.7.1