external fastcgi + apache + rewrite engine + php

Gábor Lénárt <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Hello,

I was asked to set up a quite unusal configuration, at least I can't
find information for my problem. If someone can suggest me _anything_
in this topic, please mail me (I'm not subscribed to the list, please
Cc me as well, or contact me in private). Thank you very much!

We have very large amount of virtual host which is rapidly changing, so
it's not possible to store "fixed" in apache's httpd.conf, also it's
more than Solaris' UFS can handle for a directory to use mass virtual host
(VirtualDocumentRoot and friends). So the only solution (which is good
for us for other reasons too) is using rewrite engine for this purpose.
However I can't make FastCgi to work in such a configuration, it seems
it's completly confused with the document root issue. We're using such
a config (based on some examples can be found at httpd.apache.org):

RewriteEngine On
RewriteMap lowercase int:tolower
RewriteMap vhost txt:/.../vhost-test.map
[...]
RewriteCond ${lowercase:%{HTTP_HOST}|NONE} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1 [E=VHOST:${lowercase:%{HTTP_HOST}},L]

This is only the test configuration, the real system uses external program
for RewriteMap which also does LDAP/SQL lookups an built in caching etc
(it's quite complicated, can't be done with built-in apache stuffs), with
almost 100000 of vhosts.

Of course this config (using rewrite engine) works very well on static
content, but we would like to deliver PHP support for our customers. For
various resons I would like to do it with FastCGIExternalServer.

The problem: I've tried everything with playing the configuration, google'ing
the web, etc for the whole weekend, but no solution: it simply does not work
at least I can't figure out the solution for this config.

This would be the first question: can somebody suggest me a configuration
example for this which works in such an envirnoment? (anyway even the Alias
trick does not work, according to apache error log it tries to look up
URL as file path which is virtual and not real, so it shouldn't touch anything
about the filesystem)

The second question of me is somewhat different, and maybe I would figure
out without help, but I can't reach that point yet, and maybe someone can
suggest a solution avoid me to work it for days ... This is about the
external fastCGI which is connected by apache (due to FastCGIExternalServer
-host ... configuration): is there an existing solution for a listener
fastCGI "server" which does changing uid/gid according to the requested PHP
script for example before forking a new php instance (of course if there's
a php process for that uig/gid, that should be utilized and no new instances
should be started).

Well, my English is not too good, but I hope it's understandable, and someone
can help me.

Thanks in advance,

-- 
- Gábor
___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.