Changing the port on which your website runs
Normally, when you access a website, it is running on port 80
or 443
. Any unencrypted HTTP request travels over port 80
, and the encrypted HTTPS uses port 443
. Inside IIS, it is very easy to change the port that a website is listening on if you need to do so. Probably the most common reason to institute a port change on a website is to keep it hidden from a basic port scan. Maybe you have an administrative site of some kind and want to make it more difficult to stumble across or an application programming interface (API) that runs on a different port to the main website.
Whatever your reason for wanting to change the port that a website runs on, let's walk through the steps to accomplish this task so that it can be one more tool added to your belt.
Getting ready
We have a Windows Server 2019 server online that has the IIS role installed. There is already a website running on this server. Currently, it is using port 80
by default...