[Rails] [somewhat OT] Apache config for Rails + ColdFusion + PHP
Elliott Clark
eclark at cc.gatech.edu
Thu Jul 27 18:06:19 GMT 2006
an easier way would be to have aliases for php and coldfusion apps and
have the default location serverd be redirected to the mongrel
cluster. I am in the middle of setting something like that up now.
Only without the coldfusion.
On 7/27/06, Philip Hallstrom <rails at philip.pjkh.com> wrote:
> > Our group has several web apps developed in ColdFusion, PHP, and Rails. The
> > ColdFusion and PHP apps are on an older server, and the Rails apps on a new
> > server. Ideally, we'd like them all to share the same server.
> >
> > Our current setup for the Rails server is Apache2.2 with mod_proxy_balancer
> > and mongrel_cluster. We'd like to have specific directories be processed
> > and served by Apache instead of being handed off to mongrel_cluster. For
> > example, let's say we have 3 applications:
> >
> > 1. our main website done in Rails located at the domain root
> > 2. a ColdFusion app located at /cf_app/
> > 3. a PHP app located at /php_app/.
> >
> > We'd like the ColdFusion and PHP apps to be served by Apache. Anything not
> > in those two directories should be passed off to mongrel_cluster for
> > processing.
> >
> > Any ideas on how to handle the Apache config for such a setup?
>
> We don't have cold fusion and our PHP isn't as nicely isolated as that,
> but this works for us:
>
> <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]
>
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Elliott Clark
eclark at cc.gatech.edu
eclark at nife.us
More information about the Rails
mailing list