I think this is a very good topic and your question was detailed
enough to kick start a good discussion. There is one question I have
that would help continue:

Do you want to shared the same mongrep resources for all sub-domains?
(or Passenger for that matter) This is a very important distinction
for non-Rails people coming from PHP. Rails is like a JSP/Servlet site
in that a Java/Ruby server instance must be running to work with
Apache to respond to requests. But this means on a shared/VPS server
resource usage, ie memory first and then competing for CPU.

O, please think about above and we'll continue talking. Hopefully some
other folks will chime in as this is something that I ponder as well
as to best scenario.

I can answer a little of your questions:

If sharing mongrel processes is NOT a concern, then i'd recommend SVN
externalizing or making the shared code part of a lib dir. Google "svn
external" and read a little.. And then having the rest of the rails
app be normal for each subdomain. You could also use capistrano to
deploy your app this way too. Have your shared code locally in dev
symlinked to shared rails app code. There are many ways to skin this
car.

#2 I see no issue with each app sharing the same database in the
database.yml from a mysql perspective. This is what multiple mongrels
on single Rails app do anyway. However, you must think about any app
specific issues you may encounter as a result. Do you need a subdomain
column for some records to keep this logic?

#3 ensure application.rb is not shared and thus you get your sessions
for each app?

#4 as far as overriding controllers and actions by subdomain, let's
assume you have included a lib in that has your base shared actions.
and your app includes those controllers in by default. I would think
one could redefine or override those methods.  Or make an
exclude_actions :some_action as part of the lib or something similar
and then you'd create your own action in an actual controller class in
the sub-domain rails app.

I hope this begins a dialogue of some sort.

Hank






On Nov 26, 6:19 am, icke <[EMAIL PROTECTED]> wrote:
> I am building a site that will have several different branded
> versions of the same site in order to do some SEO coverage.  
> e.gwww.foo.com,www.foo.co.ukandwww.bar.com
>
> There are many discussions on sub-domains but I would like to come up
> with a solution to support the following:
> 1. multiple domains supported as virtual hosts on Apache acting as a
> proxy where I anticipate Rewrites to do maintenance pages, pick up
> cached pages etc.
> 2. Use Mongrels as the app server but they will access the same back-
> end Rails app running against the same database.
> 3. pick up the domain from the http header which will be used to
> determine which CSS to use, affiliate-id and where to store cached
> files from sort of look-up.
> 4. User only ever sees parameters in the url without any domain-
> specific information included 
> i.e.www.foo.co.uk/quote/readnotwww.foo.co.uk/foo/quote/read
> 5. The session data will be domain specific.
> 6. Ability to over-ride views and come action controller classes by
> domain if necessary.
>
> I am a little confused about routes.rb, apache rewrites and some of
> the available plug-ins.  So for example, where should I parse the http
> header?
>
> I would be grateful if someone could let me know if I am thinking
> about this in completely the wrong way.  If not, are there any good
> information sources I should refer to?  Should I post this to the
> depolyment list?
>
> Thank you.
>
> O.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to