Friday, February 10, 2012

Using IIS Ports: Avoid the Reserved Ones

I have been using IIS for a long time and I have approached IIS setup and local hosting for development purposes in several different ways. When working alone or doing quick prototyping, is probably easier just let Visual Studio automatically assign the port when running the app, specially if you don't need it to be the same every time. However, when you are working with a team of developers and you require your web apps to use IIS and run on the same port every time, it is a good idea agree on which ports you are going to run your web applications and configure IIS accordingly, setting up and mapping your web sites to your web app's source code.

Recently I took over a project that was using this approach. The project had several web applications using IIS and we also had several environments (development, QA, staging, production, etc). The team had agreed upon using reserved IIS ports (below 1024) when working on local environments. This wasn't a big issue since once the apps where deployed on the servers, everything was configured to use specific domains, and all sites where using port 80. However, on the local environment they were setup to use the reserved ports.

I decided to do some research and see how people normally approach this, and it turns out that although all of us should have a clear understanding of IIS setup and which are the reserved ports, it turns out that most people don't know about it. People just normally go on with the idea that as long as the port is not being used, you can use it for your apps. Although this might not be a big issue when working locally, we should definitely avoid using reserved ports.

That being said, remember: Always use ports above 1024 when setting up your web apps to use IIS !

No comments:

Post a Comment