# Multihoming under OS X



## ericmurphy (Sep 26, 2002)

My understanding of this stuff is a little hazy, so please bear with me...but it's my understanding that OS X is capable of serving multiple domains from one machine. If I understand what this means, it's that you could serve, say, requests to www.somedomain.com and requests to www.sales.somedomain.com.

I know that you can serve requests in the form of www.somedomain.com/~username/, but is that all that multihoming means under OS X, or can you get more sophisticated, for example, serving up requests to both www.somedomain.com AND www.someotherdomain.com, where the second domain is actually a totally different domain, with different content, and not just a different domain pointed to the same IP address?


----------



## rharder (Sep 26, 2002)

I thought you were just getting to Apache's Virtual Domain options, but I see maybe you're not.

That'd be kinda neat to see two IP addresses going to two--or even one: you don't need to NICs--ethernet port. I guess I do that with my Airport and built-in ethernet now, but I don't serve up different content in Apache from the different interfaces.

So I don't have anything useful to add, but it's been nice talking to you.

-Rob


----------



## ericmurphy (Sep 26, 2002)

Well, maybe virtual domains would work. So I could register an additional domain, point it to my IP address, and then apache can figure out how to route requests to the individual domains? That would probably do what I need to do.


----------



## bluehz (Sep 26, 2002)

It is quite possible to do more than one ip on the same nic - ala virtual ips. I just discovered this the other day while messing with my linux box and wondered if it was also possible in OS X. Turns out it is - the syntax is a little different - but still works. See this page for the details

http://www.macosxhints.com/article.php?story=20020919053409391


----------



## rharder (Sep 27, 2002)

So the real question is can you configure Apache to have a specific Virtual Domain point to either a particular NIC or a particular IP on that NIC.

If you did some Google-ing you might find an answer on a more Apache-heavy site.

-Rob


----------



## BSDimwit (Sep 30, 2002)

Set up an alias IP for your nic card(follow the directions that bluehz attached to do that) then configure apache for IP based virtual hosting.  Granted, unless you have a compelling reason for having both of these websites on a different IP address, you should stick with name based virtualhosting where both hostnames have the same ip address.  Apache then sorts out which site gets served up by the examining the request string from the clients web browser and routing that request to the proper virtualhost.

Either way, your Mac OSX box will do the job nicely.

As a side note... what I just described is called virtual hosting...not multihoming.

Multihoming is when you have two upstream connections to the internet.  Example... I have 2 T1's...one to MCI/Worldcomm the other to Sprint.  The multihoming ability comes from the routers ability to accept connections on both T1's then figuring out which T1 is the best means of getting from point a to point b for outbound traffic.  Generally this is taken care of by various router protocols like OSPF, EIGRP(cisco stuff)... stuff like that.


----------



## ericmurphy (Sep 30, 2002)

Yeah, that looks like the right way to do it. Ideally, I'd give both domains the same IP address, and then let Apache figure out where to serve the files for each domain from.

Also, thanks for straigtening me out on the distinction between virtual hosting and multihoming.  Supposedly multihoming is enabled on my OS X machines, but I wasn't sure what that meant from a practical standpoint.


----------



## AlanCE (Aug 22, 2003)

> _Originally posted by BSDimwit _
> *As a side note... what I just described is called virtual hosting...not multihoming.
> 
> Multihoming is when you have two upstream connections to the internet. *


I've heard the term "single port multi-homing" and multi-port multi-homing for years, are you saying single port multi-homing does not exist and is simply virtual hosting with an erroneous name?


----------



## Mike Hughes (Aug 24, 2003)

There's more than one way of doing this, but it's not called "multi homing".

1.) Apache virtual servers.  Many domains to ONE ip address.

2.) Alias differnet IP addresses onto one or more IP interfaces, and bind apache to different interfaces.

3.) Combine the above methods.

Multi homing is having more than one network interface provide inbound or outbound traffic to a machine.  It's used for servers or services that need to be extremely reliable, in case one or more networking interfaces goes down (because the ISP messed up, or the power went out on one route, or whatever).


----------

