[Mongrel] Mass virtual hosting with mongrel
Charles Brian Quinn
me at seebq.com
Fri Sep 8 10:57:22 EDT 2006
I suppose not, but at that point I don't *think* there's anything to
stop you from determining, say variables like the asset_host to hit
for this particular subdomain, or the new ActiveRecord connection to
some other database (assuming you've already touched one centralized
one already), and even where to pull files from (an NFS share maybe).
Yeah, this solution really assumes a single application - if you plan
on having different versions of your app on different servers, you may
want to do some other kind of load balancing to catch it before you
hit the rails app and get in as far as our solution takes you.
Man, lighttpd has some pretty good regex rules for handling domain,
but the mod_proxy_core that you'd ultimately use to pass off to an
apache 2.1 -> mongrel is being rewritten.
Keep us updated, on what you find out (but I suppose this is a bit off-topic).
Have you seen the railsmachine gem  or even our slingshot
capistrano file  that automates vhosts pointing to different
mongrel clusters? it might be possible to automate the creation of
many vhosts for apache using it - and then farm off your mongrel
clusters to different servers.
 gem install railsmachine
On 9/7/06, John Clayton <john at fivesquaresoftware.com> wrote:
> Thanks, Charles.
> That's how we were planning on handling the DNS. What I don't think
> your approach doesn't address for us is partioning the app (db,
> config, roots, resources) to isolate the impact on performance and
> data migration. True?
> On Sep 7, 2006, at 12:43 PM, Charles Brian Quinn wrote:
> > And if this is the case, we just wrote something up on using this kind
> > of "subdomain" auth as part of a key -- all one app, serving up
> > different "content" / "dashboards" / "features":
> > http://cleanair.highgroove.com/articles/2006/08/14/simplied-
> > subdomain-authentication-in-ruby-on-rails
> > The key is a DNS wildcard record: *.yourdomain.com forwarded to the
> > main web/app server and rules for handling what it does.
> > I hope we didn't mangle your question too badly,
> > On 9/7/06, Kirk Haines <wyhaines at gmail.com> wrote:
> >> On 9/7/06, John Clayton <john at fivesquaresoftware.com> wrote:
> >>> How can one host multiple domains with mongrel? Assuming you are
> >>> mass
> >>> vhosting and you also want the performance benefits of using
> >>> mongrel ...
> >> If I remember right, you are looking at a situtation where you have a
> >> single application that will have a different look and feel applied,
> >> depending on the domain it is being served to, right?
> >> So couldn't you just set up your app to look at the SERVER_NAME and
> >> choose the theme for the content appropriately?
> >> Then you just setup your Apache vhosts and feel all the traffic into
> >> the same mongrel cluster, and you don't have to do anything at all at
> >> the Mongrel level, right? You leave it to your app to be multidomain
> >> aware?
> >> What am I missing?
> >> Kirk Haines
> >> _______________________________________________
> >> Mongrel-users mailing list
> >> Mongrel-users at rubyforge.org
> >> http://rubyforge.org/mailman/listinfo/mongrel-users
> > --
> > Charles Brian Quinn
> > self-promotion: www.seebq.com
> > highgroove studios: www.highgroove.com
> > slingshot hosting: www.slingshothosting.com
> > _______________________________________________
> > 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
Charles Brian Quinn
highgroove studios: www.highgroove.com
slingshot hosting: www.slingshothosting.com
More information about the Mongrel-users