Forum: Ruby on Rails Re: Setting up Subdomains as Account Keys Under Mac OS X

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.
Ae577905a543a759b11ce883ffd00ef6?d=identicon&s=25 Sean Mountcastle (Guest)
on 2005-12-30 18:40
(Received via mailing list)
Toby,

> Make sure you still put the port number in the url, like
> sub.domain.mine:3000

I was doing that. I finally figured out my problem, the directions in
"Dynamic VHosts Working" [1] were incorrect for Mac OS X (and probably
other Unix platforms).  In /etc/hosts you cannot add multiple entries
with the same key, like so:

127.0.0.1     localhost
127.0.0.1     sub.domain.mine
127.0.0.1     foo.domain.mine

You must add the aliases on a single line:

127.0.0.1     localhost sub.domain.mine foo.domain.mine

I also learned quite a bit about Mac OS X's lookupd.  If you type
lookupd -configuration examine the host configuration item:

LookupOrder: Cache FF NI DNS DS
_config_name: Host Configuration

You'll want to ensure that FF appears before DNS so that the entries
in your flat file (FF), /etc/hosts, are used before hitting the DNS
servers.

I'm going to update the Rails Wiki with this information.

Regards,
Sean

[1] http://www.mpet45.co.uk/articles/2005/02/02
This topic is locked and can not be replied to.