Forum: Ruby on Rails creating virtual hosts with Mongrel?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
groovetrain (Guest)
on 2009-02-19 21:03
(Received via mailing list)
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 R. (Guest)
on 2009-02-19 21:11
(Received via mailing list)
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/sw...

Cheers,
Robby



On Thu, Feb 19, 2009 at 11:02 AM, groovetrain 
<removed_email_address@domain.invalid>
wrote:
> I'm using OS X Leopard
>
> Any references or council will be appreciated, thanks in advance!
>
> groove
> >
>



--
Robby R.
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]
Frederick C. (Guest)
on 2009-02-19 21:16
(Received via mailing list)
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
groovetrain (Guest)
on 2009-02-19 22:00
(Received via mailing list)
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 C. <removed_email_address@domain.invalid>
Julian L. (Guest)
on 2009-02-20 02:58
(Received via mailing list)
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/
Robby R. (Guest)
on 2009-02-21 20:07
(Received via mailing list)
Groove,

Did you read my article? We do the following for subdomains as well.

*
http://www.robbyonrails.com/articles/2009/01/11/su...

Cheers,
Robby

On Thu, Feb 19, 2009 at 11:59 AM, groovetrain 
<removed_email_address@domain.invalid>
wrote:
>
>> > records from the database based on this.
>> > 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 R.
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]
This topic is locked and can not be replied to.