In IIS for Windows, you can specify a port for a web site under "Edit Bindings". 80 is the default port and 443 is for a secure protocol. I'd like to get a complete list of valid port ranges that can be used by a website? And if a port is allowed, what tells me if the port is available for use on that machine?
Valid ports for such use are 1-65535. In general, you should use standard ports for your services because this maximizes ease of operation and use.
netstat -nq
on Windows andnetstat -nvl
on linux (feel free to tweak the options to your liking; all you really need is the list of in-use and particularly listening ports) will tell you which ports are open, but in general you should select a port you know is not used by another application you are running (and you should not have to determine this dynamically).