I'm working on a solution where we will be setting up 40 virtual web servers on a single server using Windows 2008 w/ Hyper-V.
Unfortunately, we only have 3 free public IP addresses to use, so I need to have a basically a single public IP which would route a request to the appropriate server.
I'm thinking that I would have a web server running on the host that would run at say "web.company.com
", then each virtual server could be a sub-domain, like "client1.web.company.com
". Then, a front-end web server would proxy the request to the virtual web server for client1
.
Is that a reasonable way to configure the system? If so, can IIS be used to do that proxying or would another open-source web server work better (apache, lighttpd, etc)?
This sounds weird. 40 VMs for 40 sites?
IIS can host multiple web sites per machine. Can you not have, say, 3 servers, and use IIS host headers to host 15 sites a piece? Or does each web application instance have to be that dedicated?
Regardless you will need to do some kind of reverse proxy if you want to share a single IP across 40 boxes. You will need to set up each host name in the reverse proxy so it knows to which box to send that host header...
you have a significant cost issue if you are forced to vm each of these web sites. unless you are running windows server 2008 datacenter, you have to license the os for each vm install. 2008 enterprise includes 4 vm guests.
not to mention the headache of keeping 40 machines running instead of one (with hostheadering).
see -- http://www.microsoft.com/hyper-v-server/en/us/default.aspx
Your best bet is probably to use a load balancer (or two, in a cluster configuration) to act as the "concentrator".
It's not too different from the solution you mention, but has the benefit of permitting high availability of the resources behind the exterior access.
Sounds like a bad plan.
If you are setting up Hyper-V VM's for websites, that in of itself costs you a significant amount of money. That's why you see VPS packages with Hyper-V in the $50-$100 per month range. So why not spring for the extra $1 per month per IP or whatever from the provider? Just pass the cost on to the customers if you have them. Otherwise, if your machine can run 40 VMs, it probably costs (or cost) a lot of money, so IP's should be a drop in the bucket.
It also doesn't make financial sense to invest in the other solutions suggested here as the software cost/setup headache/ongoing pita (how are you going to implement RDP?) for setting up reverse proxies or load balancing or whatever is not worth it.
I came up with a solution. I installed the URL Rewrite extension for IIS7 and use rewrite rules to route traffic from specific sub-domains to the proper internal host.
Why not use HTTP HOST headers in IIS? Basically, each website can be told exactly which domain name to listen for and answer. I only have one IIS7 server and it's hosting 3 websites on one external IP simply because the HTTP headers are assigned...