1

I have multiple websites and of course I can't run them all in port 80 so one of my websites is using port 9090.

I've registered my IP in the domain DNS server and added hostname in the site bindings. But now I can enter my website only like that: http://website.com:9090. How can I make it open correct website by running http://website.com?

sed
  • 297
  • 2
  • 4
  • 12
  • What type of web site are you running just static html files or something like WordPress? My question being is the web site outside of IIS only configured to respond to or redirect to a base URL? – Bernie White Nov 06 '12 at 06:46
  • Also what happens if you create a new website with a single index.html and access HTTP://website.com/index.html – Bernie White Nov 06 '12 at 06:48
  • Has either of these answered your question? – Bernie White Nov 29 '12 at 08:39
  • How did you get solution? I have the same issue http://subdomain.domain.com:5000/ is ok, but I want http://subdomain.domain.com for a website in IIS using port 5000. – Kiquenet Nov 06 '17 at 09:20

2 Answers2

2

There are two main options to run a multiple web sites on a single server like you have described.

Update: Server Name Indication (SNI) changed support for this, allowing supported browsers/servers to access/host multiple TLS protected sites on one IP using host headers to separate them.

Host Header on one IP

IIS can be configured to look at the host header for an incoming request route it to the correct web site even on a single IP address.

This is done by configuring the site bindings and specifying a host name value for all websites on the same IP address. Your web sites will commonly fail to start or generate errors if you have only some of web sites on the same IP bound to a host header. See http://technet.microsoft.com/en-us/library/cc753195%28v=WS.10%29.aspx for more information.

This method does not work for HTTPS i.e. SSL/TLS encrypted. This is because the protocol itself is an encrypted tunnel between IP addresses that does not parse a host header in the tunnel establishment.

Website on individual IP Addresses

Another approach is to separate each website on a separate IP address. This may not be an option available to you for Internet facing websites because you may not have access to more then one IP address. It is great for intranet websites because you can easily troubleshoot issues from the network layer. This option will also work for HTTPS web sites.

To configure this you would:

  1. Assign an additional IP address to the operating system using network connections and then editing the TCP/IP properties on the network connection. After you have added an addition IP address it will appear in IIS to bind to.
  2. If you have any existing web sites make sure that they are not bound to the same IP address.
  3. Add or edit a site binding to the new IP address. See http://technet.microsoft.com/en-us/library/cc771629.aspx

Hope that helps.

Bernie White
  • 1,024
  • 7
  • 17
0

It's time to take it back to the basics. You need to review the TechNet documentations on Setting up Host Headers in IIS

Brent Pabst
  • 6,059
  • 2
  • 23
  • 36
  • I did excatly what it said in the documentation. It runs on `localhost` when I set no host header, and when I set host header it shows 404. – sed Nov 05 '12 at 15:55
  • Are you running everything on port 80 when you setup the host headers? You should be. – Brent Pabst Nov 05 '12 at 16:47
  • Yes, of course. I can give some screenshots displaying my configuration later. Currently I have only one website anyway. – sed Nov 05 '12 at 17:13