Does thin have anything akin to mongrel's --prefix option which, when
combined with Apache's ProxyPass command, allows you to easily run
multiple rails apps on the same domain, each in their own subfolder
(ie, www.domain/myapp1www.domain/myapp2 etc.?) I find this option to
be extremely useful in mongrel and really the only way I've found to
easily achieve multiple apps on the same domain (at least with Apache;
I don't have the option of running ngnix or other).
Look into MultiURL (?) in Rack. It allows for multiple Rack apps to be run under the same process.
AEM
On Jan 7, 2008 9:38 AM, François Montel <zeroh...@gmail.com> wrote:
> Thin looks very promising.
> Does thin have anything akin to mongrel's --prefix option which, when > combined with Apache's ProxyPass command, allows you to easily run > multiple rails apps on the same domain, each in their own subfolder > (ie, www.domain/myapp1www.domain/myapp2 etc.?) I find this option to > be extremely useful in mongrel and really the only way I've found to > easily achieve multiple apps on the same domain (at least with Apache; > I don't have the option of running ngnix or other).
> Look into MultiURL (?) in Rack. It allows for multiple Rack apps to be run
> under the same process.
> AEM
> On Jan 7, 2008 9:38 AM, François Montel <zeroh...@gmail.com> wrote:
> > Thin looks very promising.
> > Does thin have anything akin to mongrel's --prefix option which, when
> > combined with Apache's ProxyPass command, allows you to easily run
> > multiple rails apps on the same domain, each in their own subfolder
> > (ie,www.domain/myapp1www.domain/myapp2etc.?) I find this option to
> > be extremely useful in mongrel and really the only way I've found to
> > easily achieve multiple apps on the same domain (at least with Apache;
> > I don't have the option of running ngnix or other).
As it stands now, the Rails adapter for Rack that is supplied with
Thin will not properly handle SCRIPT_NAME as a prefix for your app.
However, if you add this line to the rack adapter, it seems to work:
Line 48: ActionController::AbstractRequest.relative_url_root =
env['SCRIPT_NAME'] unless env['SCRIPT_NAME'].blank?
Line 49: Dispatcher.dispatch(cgi, session_options, response)
That's quick and dirty, and I haven't really tested it too much. Hope
it helps though.
- Brian
On Jan 7, 9:09 am, macournoyer <macourno...@gmail.com> wrote:
> Like Adrian mentioned, you can do it w/ a custom Rack config.ru file
> and run it w/ rackup (and do almost anything you can dream of w/ that
> file).
> I added it to the TODO to include --prefix option in the thin script.
> If you wanna contribute that'd be a good way :)
> On Jan 7, 12:03 pm, "Adrian Madrid" <aemad...@gmail.com> wrote:
> > Look into MultiURL (?) in Rack. It allows for multiple Rack apps to be run
> > under the same process.
> > AEM
> > On Jan 7, 2008 9:38 AM, François Montel <zeroh...@gmail.com> wrote:
> > > Thin looks very promising.
> > > Does thin have anything akin to mongrel's --prefix option which, when
> > > combined with Apache's ProxyPass command, allows you to easily run
> > > multiple rails apps on the same domain, each in their own subfolder
> > > (ie,www.domain/myapp1www.domain/myapp2etc.?) I find this option to
> > > be extremely useful in mongrel and really the only way I've found to
> > > easily achieve multiple apps on the same domain (at least with Apache;
> > > I don't have the option of running ngnix or other).
I forgot to mention, that is the solution for Rack (using URLMap); the
Thin start script would still need to be patched to use this (but that
should be trivial).
For example:
map '/myapp' { run Rack::Adapter::Rails.new(:root => 'myapp') }
map '/' { run Rack::Adapter::Rails.new(:root =>
'my_default_app') }
- Brian
On Jan 9, 10:36 pm, Lytol <Brian.E.Sm...@gmail.com> wrote:
> As it stands now, the Rails adapter for Rack that is supplied with
> Thin will not properly handle SCRIPT_NAME as a prefix for your app.
> However, if you add this line to the rack adapter, it seems to work:
> Line 48: ActionController::AbstractRequest.relative_url_root =
> env['SCRIPT_NAME'] unless env['SCRIPT_NAME'].blank?
> Line 49: Dispatcher.dispatch(cgi, session_options, response)
> That's quick and dirty, and I haven't really tested it too much. Hope
> it helps though.
> - Brian
> On Jan 7, 9:09 am, macournoyer <macourno...@gmail.com> wrote:
> > Hey François,
> > Like Adrian mentioned, you can do it w/ a custom Rack config.ru file
> > and run it w/ rackup (and do almost anything you can dream of w/ that
> > file).
> > I added it to the TODO to include --prefix option in the thin script.
> > If you wanna contribute that'd be a good way :)
> > On Jan 7, 12:03 pm, "Adrian Madrid" <aemad...@gmail.com> wrote:
> > > Look into MultiURL (?) in Rack. It allows for multiple Rack apps to be run
> > > under the same process.
> > > AEM
> > > On Jan 7, 2008 9:38 AM, François Montel <zeroh...@gmail.com> wrote:
> > > > Thin looks very promising.
> > > > Does thin have anything akin to mongrel's --prefix option which, when
> > > > combined with Apache's ProxyPass command, allows you to easily run
> > > > multiple rails apps on the same domain, each in their own subfolder
> > > > (ie,www.domain/myapp1www.domain/myapp2etc.?) I find this option to
> > > > be extremely useful in mongrel and really the only way I've found to
> > > > easily achieve multiple apps on the same domain (at least with Apache;
> > > > I don't have the option of running ngnix or other).