[Mongrel] Ruby+Apache2.2+ProxyLoadBalance ...... +PHP??

Philip Hallstrom mongrel at philip.pjkh.com
Wed Aug 30 12:20:55 EDT 2006


> Hi,
> I just realice that I can't run php code anymore once I installed my dear
> mongrels (under an Apache Proxy Balancer).
>
> I'm just trying to run the clasic phpinfo() in the following file
> /var/rubyapp/public/phpinfo.php ... but instead of being executed the code
> is being displayed as plain text ... This is the ouput :))
>
>           <?PHP phpinfo(); ?>
>
> anyone can give a hint please on how to have Ruby and PHP code under
> Apache  Proxy  Balancer?

My httpd.conf looks like this (excluding the parts that bring in standard 
PHP stuff).  Works fine for us.  The only thing that doesn't work are URLs 
like: http://foo/path/to/phpscript.php/path/info/here.

   <Proxy balancer://mongrel_cluster>
     BalancerMember http://127.0.0.1:8805
   </Proxy>

   RewriteEngine On

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d
   RewriteRule ^(.+[^/])$ $1/ [R]

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} \.php
   RewriteRule ^(.*)$ $1 [QSA,L]

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.html -f
   RewriteRule ^(.*)$ $1/index.html [QSA,L]

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME}/index.php -f
   RewriteRule ^(.*)$ $1/index.php [QSA,L]

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d
   RewriteRule ^(.*)[^/]$ $1/ [QSA,L]

   RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
   RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]



More information about the Mongrel-users mailing list