Re: Setting up Subdomains as Account Keys Under Mac OS X

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