Hi,

have analysed the php code, and have effectively found that execute all file the proxy sent to it...
and some time in binnary file found "<?" tag... and make an error...

have modify php to execute only php file... and now work correctly!

and also modifyed to find index.xxx file if directory are sended by the proxy...

and redirect http://mysite/myprefix to http://mysite/myprefix/ if myprefix is directory on php side.

this modification must work also with apache v2.3 proxy fastcgi module...

have modifyed my proxy code to correct content-type after readed header from fastcgi server, in calling ap_run_type_checker explicitly...

for the moment all this modification are not parameterized...

i while add apache option and php option to controle effect of this modification...

have posted update on sourceforge: http://mproxyfcgi.sourceforge.net

Mathieu

From: Mathieu CARBONNEAUX [mailto:[EMAIL PROTECTED]
To: dev@httpd.apache.org
Sent: Sun, 28 May 2006 13:48:59 +0200
Subject: [EMAIL PROTECTED] about mod_proxy_fcgi....

Hi,

Have developed for apache v2.0 a mod_proxy_fcgi (http://mproxyfcgi.sourceforge.net) like mod_proxy_ajp of Apache 2.2…
And later have seen some have developed the same thing in 2.3 dev tree…

My need is real fastcgi proxy (mod_fastcgi make very bad job in this way!) on apache 2.0…

Ok, but if it possible to work together on the different problem I've seen and on what I'm working to correct…

- 1 -
All fastcgi server implementation hare based on fastcgi spec…
And are based on mod_fastcgi logic, and mod_fastcgi send only script to fastcgi server to execute…
No gif, jpeg or other files!!!!
And for example php fastcgi send systematically text/html for all file…

For that have try to use mime_magic without success, I'm not sure but I think mime magic not work with proxy module (hook after proxy ?!!)...
I've not investigated too I source to see why mime magic don’t whant to correct mime type... I'm not sure if actually can do that...

Trying to correct mime type on apache proxy is only a temporally solution, the ideal solution is to modify server fastcgi implementation to set correctly the mime type on each file it serv...

And after I'm not sure all fastcgi implementation of scripting language can correctly manage other file than script without problem...
Php seem to accept correctly that type of file... but he tries to interpret all file not just php file... is not the good way...
I think is necessary to modify fastcgi implementation to manage a filter to send directly file if not have the good extension...
To prevent bad interpretation of file that is in binary format...and over cpu on fastcgi server to try to interpret script on any binary file...

- 2 -
In mod_fastcgi the index searching are managed by apache… not by the fastcgi server…
If you try to go to http://myserverhttp/myappfcgi/ (with PassReverse /myappfcgi fcgi://myfcgiserver:10000)
You receive "no imput file" error from php... because is a directory...
And php not manage the fact if index.php (or other index) exists...

Is a possibility to mod_proxy_fcgi to try any index, 404 errors on file terminated by "/"... but is time consuming to send each time a request to check if index.xxx exists...
But is a temporary solution, and also on this problem the good way is to modify fastcgi server to implement index searching option...

Have maked a patch for php to do that (hard coded...no option to set index file list... for the moment...), and it work fine!
I will post on sourceforge in the next week...

- 3 -
fastcgi implementation define the possibility (define actually this var : "FCGI_MAX_CONNS","FCGI_MAX_REQS","FCGI_MPXS_CONNS") to get parameter value from fastcgi server with FCGI_GET_VALUES management record...
To generate PATHTRANSLATED correctly to the target fastcgi server tree...

My idea is to add new VALUE to get (at proxy first connection to that server...!?) from fastcgi server is the "DOCUMENT_ROOT" to base the PATHTRANSLATED generation on automatically it...

In other way, I'm adding the possibility to force target DocumentRoot in apache proxy module by configuration option...

- 4 -
The fastcgi specification make possible to manage keepalive (and the possibility to mux different request in one connexion!)...
But any implementation has seen of this protocol don’t use it: mod_fastcgi, lighttpd, mod_fcgid, the 2.3 mod_proxy_fcgi, all close connection after each request...

It is to be regretted that not possible to do that...

Have tried to do keepalive with php, and some time have fastcgi record of other request (have used real different id on each request from apache request id)...

I go to try to send systematically FCGI_ABORT_REQUEST management record if apache abort request and wait for FCGI_END_REQUEST ...
But I'm not sure that will work...

The ideal is to have packet system (fastcgi use record like packet...) attach to a pool of connexion...
Based on bucket implementation (that only handle FastCGI header...)??! Each bucket = fastcgi record (have seen some thing like that in mod_fcgid?...)!!!?? How to do that??!!
Packet systems that send only record based on request id to the good proxy handle have begun the fastcgi request...


- 5 -
Fastcgi implementations specify the possibility (FCGI_KEEP_CONN on FCGI_BeginRequestBody struct field "flags") on FCGI_BEGIN_REQUEST record to specify the socket close mode...
Actually all implementation I've seen force close from FastCGI client (apache side)...

I'm not sure is a good thing to close on apache side... (Generate many TIME WAIT on FastCGI server side...)

Have tried to use FastCGI server close side...
But not receive the end of the request (on php implementation, have not tested other one...)...
But I've not found why php don’t send the end of the request...


The 1 and 2 are major problem, 3 are moderated problem, and 4 and 5 are minor...

I'm very interested on you idea on this problem...

Best regards,
Mathieu

Reply via email to