I have 2 physical servers where each server is running Microsoft windows server and each is hosting multiple websites. Is it possible to run both servers on same IP address? and how is it done?
- Do you want both sites to present on port 80 of this single IP address?MadHatter– MadHatter2014-07-16 08:43:04 +00:00Commented Jul 16, 2014 at 8:43
- Yes, since each site has its own domain name. Currently im running multiple websites on one physical server.I want each site to has its own physica server, but I only have one single IP.user140239– user1402392014-07-16 08:47:20 +00:00Commented Jul 16, 2014 at 8:47
2 Answers
There are 2 things you can do:
You can get a Load Balancer (or configure Round Robin in windows) and configure a "Web Serving" pool for example, and add both servers to the pool.
Then, each request will first get to the floating IP address which you will attach to the pool. You can choose how do you want the load balance to work, based on CPU, number of http connections, etc...
You can use DNS redirection, meaning 2 physical hosts with different IP's but the same Host, then on every request it will go to one of the servers.
The first option is the best one for you I believe. The second option will actually work only in a local area network and thus I believe it's useless for you.
- It seems to me that option 1 is the layer-4 proxying arrangement that I suggested, and I don't understand option 2 at all. Could you elaborate on it?MadHatter– MadHatter2014-07-16 08:56:59 +00:00Commented Jul 16, 2014 at 8:56
-
- can you use Load Balancer even if u have different domain names?user140239– user1402392014-07-16 09:03:34 +00:00Commented Jul 16, 2014 at 9:03
- Yes you can, I believe all Load Balancers support it.Itai Ganot– Itai Ganot2014-07-16 09:05:02 +00:00Commented Jul 16, 2014 at 9:05
This is possible, but it will be messy, and increase the number of single points of failure.
I'm assuming that you have some kind of single-IP connection to the site where the servers reside, the servers being inside some kind of firewall/NAT device, themselves having RFC1918 addresses. Stop me if any of that is wrong.
You can set up a third internal machine which runs a proxy on port 80, which in turn knows about the two internal servers and the sites which are on each (usually via internal DNS). You then forward port 80 of the external IP address to this proxy's port 80, and it takes care of receiving client requests, satisfying them from the relevant existing server, and returning the data to the client.
Let me be clear: this is a horrible and messy solution, and you shouldn't do it. Moreover, I'm fairly sure there is no way of doing it without some kind of layer-4-aware arrangement. But yes, it can be done.