Does anyone know how to use Mongrel to create virtual hosts? My production site will have all kinds of domains pointing to it, and I also need to figure out how to do subdomains. Rails should react to the host name, doing a lookup based on the name and pull different records from the database based on this. For example, I''d like www.mysite.com to point back to 127.0.0.1:3000, and the same for username.productionsite.com. I''m using OS X Leopard Any references or council will be appreciated, thanks in advance! groove --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You might consider switching to Passenger for stuff like this. This is how our team is tackling this without much effort. Takes just a few minutes to setup/switch. Here is a writeup on it (for OS X). http://www.robbyonrails.com/articles/2009/02/11/switch-to-passenger-mod_rails-in-development-on-osx-in-less-than-7-minutes-or-your-money-back Cheers, Robby On Thu, Feb 19, 2009 at 11:02 AM, groovetrain <joelgreutman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Does anyone know how to use Mongrel to create virtual hosts? My > production site will have all kinds of domains pointing to it, and I > also need to figure out how to do subdomains. Rails should react to > the host name, doing a lookup based on the name and pull different > records from the database based on this. > > For example, I''d like www.mysite.com to point back to 127.0.0.1:3000, > and the same for username.productionsite.com. > > I''m using OS X Leopard > > Any references or council will be appreciated, thanks in advance! > > groove > > >-- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 19 Feb 2009, at 19:02, groovetrain wrote:> > Does anyone know how to use Mongrel to create virtual hosts? My > production site will have all kinds of domains pointing to it, and I > also need to figure out how to do subdomains. Rails should react to > the host name, doing a lookup based on the name and pull different > records from the database based on this.Typically people use nginx, apache etc... to handle the nuts and bolts side of virtual hosts. There''s railscasts on using subdomains (http://railscasts.com/episodes/123-subdomains ) Fred> > > For example, I''d like www.mysite.com to point back to 127.0.0.1:3000, > and the same for username.productionsite.com. > > I''m using OS X Leopard > > Any references or council will be appreciated, thanks in advance! > > groove > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Both of these are very helpful, thank you both so much. Does passenger allow for full domain names? Kindof like pseudo-hosts, like having a full www.alskdfjhdsaf.com pointed back to localhost: 3000? Is there some way of doing this by hacking the /etc/hosts file? Groove On Feb 19, 2:15 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 19 Feb 2009, at 19:02, groovetrain wrote: > > > > > Does anyone know how to use Mongrel to create virtual hosts? My > > production site will have all kinds of domains pointing to it, and I > > also need to figure out how to do subdomains. Rails should react to > > the host name, doing a lookup based on the name and pull different > > records from the database based on this. > > Typically people use nginx, apache etc... to handle the nuts and bolts > side of virtual hosts. There''s railscasts on using subdomains (http://railscasts.com/episodes/123-subdomains > ) > > Fred > > > > > For example, I''d likewww.mysite.comto point back to 127.0.0.1:3000, > > and the same for username.productionsite.com. > > > I''m using OS X Leopard > > > Any references or council will be appreciated, thanks in advance! > > > groove--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mongrel will respond to everything with the same app. The app, however has access to A request.env variable which has hostname in it. Inspect it to find out more. Blog: http://random8.zenunit.com/ Learn rails: http://sensei.zenunit.com/ On 20/02/2009, at 6:02 AM, groovetrain <joelgreutman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Does anyone know how to use Mongrel to create virtual hosts? My > production site will have all kinds of domains pointing to it, and I > also need to figure out how to do subdomains. Rails should react to > the host name, doing a lookup based on the name and pull different > records from the database based on this. > > For example, I''d like www.mysite.com to point back to 127.0.0.1:3000, > and the same for username.productionsite.com. > > I''m using OS X Leopard > > Any references or council will be appreciated, thanks in advance! > > groove > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Groove, Did you read my article? We do the following for subdomains as well. * http://www.robbyonrails.com/articles/2009/01/11/subdomain-accounts-with-ruby-on-rails-explained Cheers, Robby On Thu, Feb 19, 2009 at 11:59 AM, groovetrain <joelgreutman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Both of these are very helpful, thank you both so much. > > Does passenger allow for full domain names? Kindof like pseudo-hosts, > like having a full www.alskdfjhdsaf.com pointed back to localhost: > 3000? > > Is there some way of doing this by hacking the /etc/hosts file? > > Groove > > On Feb 19, 2:15 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 19 Feb 2009, at 19:02, groovetrain wrote: >> >> >> >> > Does anyone know how to use Mongrel to create virtual hosts? My >> > production site will have all kinds of domains pointing to it, and I >> > also need to figure out how to do subdomains. Rails should react to >> > the host name, doing a lookup based on the name and pull different >> > records from the database based on this. >> >> Typically people use nginx, apache etc... to handle the nuts and bolts >> side of virtual hosts. There''s railscasts on using subdomains (http://railscasts.com/episodes/123-subdomains >> ) >> >> Fred >> >> >> >> > For example, I''d likewww.mysite.comto point back to 127.0.0.1:3000, >> > and the same for username.productionsite.com. >> >> > I''m using OS X Leopard >> >> > Any references or council will be appreciated, thanks in advance! >> >> > groove > > >-- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting w/Ruby on Rails http://planetargon.com/ http://robbyonrails.com/ http://twitter.com/planetargon aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---