Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a windows server 2008 with IIS7 with 4 websites. In DNS I have 4 different URLs which point to the IP of the server. I configured each web site with the site bindings:

website1: hostname: url1, port: 80, IP-Adresse: the adress of the server

website2: hostname: url2, port: 80, IP-Adresse: the adress of the server

The result is, that from the client, I can browse with all the 4 URLs to the specified web sites and everything is fine.

Then I changed in IIS the port of the websites, so that website1 now uses port 8080, website2 uses port 8081, and so on. Now I have to use the browser with the url and the portnumber (like URL:8080). Is there a possibility, to configured the websites with different portnumbers but not to use the portnumbers in the browser?

share|improve this question
1  
Why did you find it necessary to add different ports for each of your websites when the host headers were working fine? –  Dscoduc Mar 30 '10 at 15:55
    
Cause of security rules of our company, we should not use port 80. –  Queensheep Mar 31 '10 at 6:31

2 Answers 2

Yes, but only if your environment includes a NAT firewall/router and multiple external IP addresses.

For http connections, the port number is optional on the browser only if the browser is connecting on port 80. Therefore, the browser would need to connect to port 80 in order for the port number to be optional in the URL.

Here is one possible scenario:

  1. You control the 101.101.101.0/20 subnet.
  2. website1.com: DNS "A" record points to 101.101.101.2
  3. website2.com: DNS "A" record points to 101.101.101.3
  4. Your IIS7 server has a local IP address of 192.168.0.67
  5. Firewall/router has a NAT rule redirecting 101.101.101.2:80 to 192.168.0.67:8080
  6. Firewall/router has a NAT rule redirecting 101.101.101.3:80 to 192.168.0.67:8081

With the firewall/router configured in this way, the browser clients would think they were connecting on the standard port 80, so no port number would need to be used in the external URL. However, the connections would be routed to ports 8080 and 8081, respectively, on your private network.

Is there a specific reason why you would like to use non-standard ports on the web server without requiring them to be entered as part of the URL?

Cheers,

Miles

share|improve this answer
    
Thanks for your answer. Cause of security rules of our company, we should not use port 80. I just wanted to keep it simple for the users, so that they can type the url without the portnumber. –  Queensheep Mar 31 '10 at 15:27

Why not just use virtual hosts, since they're designed to handle multiple sites on the same IP address?

If you really want to do it the hard way, a service like DynDNS's WebHop would do what you're after.

share|improve this answer
    
Virtual hosts is in IIS7 now called virtual directories, right? With this I still need at least one website with port 80 and this website then has several virtual directories. So I suppose there is no way to configure IIS7 (or the w2k8 server) that it listens on port 80 but redirect the clients request to another port like 8080. –  Queensheep Mar 31 '10 at 15:21
    
I don't use IIS so can't say. You still haven't said why you want to use a non-standard port and don't want to use virtual hosts. –  Cry Havok Mar 31 '10 at 18:08
    
Cause of security rules of our company for intranet applications, we should not use the standard port 80. I wanted to keep it simple for the users, but I suppose they have to write the portnumber to the url. –  Queensheep Apr 1 '10 at 14:57
    
Ah, security through obscurity - also known as none at all ;) You could configure your primary IIS server to perform the redirection, but anything you do to redirect users negates the pretend security using a non-default port provides. –  Cry Havok Apr 1 '10 at 19:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.