[Mongrel] Multiple rails apps with Mongrel

Alexander Kabanov shurikk at gmail.com
Thu Sep 7 19:16:17 EDT 2006


in addition to relative_url_root you need to create a symlink in your
application "public" directory like

ln -s . app1

after this, static content like images, css etc. will work

--Alex

On 9/7/06, Eoin Curran <eoin at peelmeagrape.net> wrote:
>
>  Try putting:
>  ActionController::AbstractRequest.relative_url_root =
> '/app1'
>  in your production.rb
>
>  e.
>
>  zer0halo wrote:
> Thanks, Bryan, I tried it and am partway there, but it's still not working.
>
>  http://domain/app1/controller/method
>
>  does run the method and display the view, but the images and stylesheets
> are not loading (whether or not I have a ProxyPass for the images and
> stylesheets as you have below - I tried both with and without.) Also all
> links to other methods fail because ....
>
>  http://domain/app1/controller
>
>  redirects me to:
>
>  http://domain/controller
>
>  Which gives be an Apache 'page not found' error.
>
>  I presume that would be something to fix in routes.rb, but I tried a couple
> of things and they didn't work.
>
>  Thanks for any help.
>
>
> On 9/7/06, Bryan Thompson <bryan at galisys.com> wrote:
> >
> >
> >
> > I think this is basically how we're doing it.
> >
> >
> > <Proxy balancer://app1balancer>
> > BalancerMember http://127.0.0.1:6000
> > BalancerMember http://127.0.0.1:6001
> > BalancerMember http://127.0.0.1:6002
> >
> > BalancerMember http://127.0.0.1:6003
> > BalancerMember http://127.0.0.1:6004
> > </Proxy>
> >
> >
> > <Proxy balancer://app2balancer>
> > BalancerMember http://127.0.0.1:7000
> > BalancerMember http://127.0.0.1:7001
> > BalancerMember http://127.0.0.1:7002
> >
> > BalancerMember http://127.0.0.1:7003
> > BalancerMember http://127.0.0.1:7004
> > </Proxy>
> >
> >
> > <VirtualHost *:80>
> > ProxyPass /app1/images !
> > ProxyPass /app1/stylesheets !
> > #continue with other static files that should be served by apache
> >
> >
> > ProxyPass /app2/images !
> > ProxyPass /app2/stylesheets !
> > #continue with other static files that should be served by apache
> >
> >
> > Alias /app1/images /path/to/public/images
> > Alias /app1/stylesheets /path/to/public/stylesheets
> >
> > #continue with aliases for static content
> >
> >
> > Alias /app2/images /path/to/public/images
> > Alias /app2/stylesheets /path/to/public/stylesheets
> > #continue with aliases for static content
> >
> >
> > ProxyPass /app1 balancer://app1balancer
> >
> > ProxyPass /app2 balancer://app1balancer
> > </VirtualHost>
> >
> >
> >
> > Bryan
> >
> >
> >
> > On Sep 7, 2006, at 4:06 PM, zer0halo wrote:
> >
> > I'm trying to set up several different Rails apps on the same domain, each
> one running Mongrel. After reading all of the documentation, it's fairly
> clear how to use subdomains - create several Apache virtual hosts, each of
> which has a different ProxyPass and ProxyPassReverse command to redirect
> from different ports (ie, 3000, 3100), and then have each Mongrel instance
> (or cluster) set to the corresponding port (3000, 3100). [If this theory is
> incorrect, please let me know!]
> >
> > However, what I'm trying to acheive is to host them all under the same
> domain. In othe words, I would like to have
> >
> > www.domain.com/app1
> > www.domain.com/app2
> >
> > I don't know how to acheive this. Do I make each of them Virtual Hosts,
> each with their own ProxyPass? (But I haven't been able to find any simple
> documentation online explaining how to set a Virtual Host at
> www.domain.com/app1 instead of app1.domain.com. I know fairly little about
> Apache.)
> >
> > I noticed in the Mongrel documentation mention of a --prefix command and I
> was wondering if that could be used to host multiple apps, but for one it's
> not clear how that ties in with Apache, and secondly, the latest version of
> mongrel_rails doesn't recognize that command.
> >
> > Any possibilities? Thank you.
> >
> > --
> > "Impossible is nothing."
> >
> > _______________________________________________
> > Mongrel-users mailing list
> > Mongrel-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/mongrel-users
> >
> > _______________________________________________
> > Mongrel-users mailing list
> > Mongrel-users at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/mongrel-users
> >
> >
>
>
>
>  --
>  "Impossible is nothing." ________________________________
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
>
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users
>
>


More information about the Mongrel-users mailing list