Avatar of Rob Rudloff
Rob Rudloff
Flag for United States of America asked on

How to host multiple websites at same IP and Port on IIS 7 ?

Hi.  
We have IIS7 hosting our current website https://banana.net at 104.18.28.202 (port 80 and 443).  That is the only website on that webserver, and it works fine.
I want to host a second website http://tommy.biz at the same IP address (port 80 only, no certificate yet).  I have set up the bindings for both sites with the same IP address and port as shown in images below.  
Where do I specify that traffic for banana.com gets routed to the banana.net site/folder, and the tommy.biz traffic goes to the tommy.biz site/folder.
Thanks
Rob

(note: names and IP's have been changed to protect the innocent)
Web DevelopmentMicrosoft IIS Web Server

Avatar of undefined
Last Comment
Charlie Arehart

8/22/2022 - Mon
Sam Jacobs

You do that by putting banana.net as the hostname for the banana.net site (you might also want to add one for www.banana.net), and tommy.biz as the hostname for the tommy.biz.site.
Rob Rudloff

ASKER
Hi Sam --
Is what you're suggesting different than what I show in those images?  Or do I do that somewhere else?
Thanks
Rob
Sam Jacobs

BTW, make sure that for the HTTPS bindings you check Require Server Name Indication so you can host multiple SSL certificates.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Sam Jacobs

Nope ... looks like you got it.
Rob Rudloff

ASKER
Your "edit site binding" looks different than mine, and doesn' thave the "Require Server name" option.  Are you IIS7?  Mine looks like the sample below:
Sam Jacobs

Yikes ... I am so sorry! I totally missed that you were running IIS7.
I am running IIS10 on a Windows 10 workstation.
Unfortunately, you will need to multi-home (add another IP address) in order to have 2 SSL certificates on IIS7, which does not have SNI.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
kevinhsieh

Maybe time to upgrade to a supported OS that gets security updates?

I wouldn't run an public web site on outdated Windows. If they're basic sites, they should run on linux anyways.
Charlie Arehart

Rob, you do indeed show you already have the needed sites with the needed binding (for http, at least). And your question seems as much focused on http, and that it's not working.

In that case, the issue seems not to be with IIS. First, do you have dns setup so that tommy.biz resolves to that 104.18.28.202 address? If you do a ping from the command line of that domain, does it show that ip address? (You say both have been changed here from what they really are, so we can't test this ourselves.)

If you find it does not work, then it's simply that your dns is not setup. BTW, you could use your local hosts file to test things temporarily. I won't elaborate on that, in case you already know about it or it's not needed here.

Let us know what you find. And please confirm if your issue is indeed with both http and https. 
Rob Rudloff

ASKER
Thanks for your response Charlie --
Yes, the DNS for the new domain/website resolves to the same IP as our current domain/website.  
The problem is that this is a production server (actually two servers), but I have to do this off-hours to test it.  (If I take one server off-line and test my changes there, I can't get the DNS to resolve to that server specifically ... However, when we started all this, we did it on the production server (while in production) and broke everything -- the DNS was set right and it seems that IIS was set right.  So, I'll have to wait to try again.

I was playing with the "hosts" file.  In production, there are no entries in the host file.  If I put an entry in there, for testing, but it didn't work -- no surprise though, I'm unclear as to what the hosts file affects.

Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Sam Jacobs

The hosts file affects DNS resolution for the PC or server that it's on, and overrides all other DNS resolvers.
So, for example, if you added:
142.250.72.142      www.microsoft.com
to your hosts file, then when you browse to www.microsoft.com from your machine, it would sent you to Google.
ASKER CERTIFIED SOLUTION
Charlie Arehart

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Sam Jacobs

There is also a Chrome extension called Website IP (https://chrome.google.com/webstore/detail/website-ip/ghbmhlgniedlklkpimlibbaoomlpacmk?hl=en) which will put the IP of the site you are browsing to in the lower corner of your page - useful to verify that you're hitting the IP address you expect.
Rob Rudloff

ASKER
Thanks.  All those clues, we got it figured out.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Charlie Arehart

That's great, Rob, seriously. And might there be any tidbit you could share which may clue readers into what ever you may have found or did, if it might help them also? Or do you think it was some unique problem on your end?

No worries if you just need to consider it case-closed. I understand how a problem plaguing you for months can leave you exhausted and just wanting to move on. :-) In that case, hopefully folks could benefit from other ideas shared here when you first raised it.