Bootstrap FreeKB - Microsoft IIS - Default port
Microsoft IIS - Default port

Updated:   |  Microsoft IIS articles

Let's say you have two websites in IIS, one called www.example.com and the other called qa.example.com. www.example.com will use ports 80 and 443. To be able to connect to qa.example.com, we need to use a different port. Follow these steps to change the default port in IIS:

  1. In IIS, expand the root directory and expand Sites
  2. Right click on qa.example.com and select Edit Binding
  3. In the Site Bindings dialog box, select the binding and select Edit
  4. Change the port from 80 to any other port number, such as 8080 and select OK
  5. In the right panel of IIS, select Restart to restart the website

 

The port will need to be opened in the router and Windows Firewall:

The following command will need to be run with administrative priviledges:

netsh http add urlacl url=http://<your ip address>:8080/ user=everyone

 

The port will need to be added to the applicationHost XML file.

  1. Navigate to C:/Windows/System32/inetsrv/config
  2. Open the file applicationHost in Notepad

Note: Do not use Notepad++. Notepad++ is a 32-bit application, and Windows Explorer is a 64-bit application, which is why Notepad must be used.

  1. In the applicationHost file, locate the section that lists the bindings, and add the following: <binding protocol="http" bindingInformation="*:8080:<your ip address>" />

Note: Do not enter <binding protocol="http" bindingInformation="*:8080:*" /> .

  1. Save the changes, and close Notepad.

 

To test this, go to http://qa.example.com:8080 and the default page of qa.example.com should be displayed. Do not use the IP address, such as http://192.168.0.3. IIS needs to get the name of the website. If a problem occurs, view the IIS log files at C:/inetput/logs/LogFiles/W3SVC1/.

 

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 91bcdf in the box below so that we can be sure you are a human.