While developing at work, I often need to switch between multiple projects running on my localhost. In Windows XP this can be cumbersome due to the artificial limitation on the number of websites allowed under IIS. Gregory Reddick posted the trick to removing that artificial barrier and I’ve re-posted it here for my own reference:
In the server versions of Windows, you can have multiple versions of web sites installed into IIS and running simultaneously. You can install and run more than one web site within IIS in the professional version of Windows XP or Windows 2000. You just have to pull a trick to modify the IIS metabase to that it is aware of the additional sites. The user interface does not support creating more than one web site. Also, you still will not be able to have more than one site running at the same time.
- Create a command prompt window.
- Navigate to:
- Find out what the highest numbered site you currently have is. You can do that by typing:
adsutil.vbs ENUM /P W3SVC
- Run the below command, where X is replaced by the current highest numbered site + 1:
adsutil.vbs COPY W3SVC/1 W3SVC/X
For example if the highest numbered site is 4, then type this:
adsutil.vbs COPY W3SVC/1 W3SVC/5
- Run the IIS Manager.
You should find a new site has been created. It will be an exact copy of site #1, so you will need to change a few things. Go into the properties for the web site. Change the site name, and the virtual directory for the root of the web site to point to another location on the hard disk.
Note that you will not be able to have more than one site running at the same time. To use the site, you must first stop the currently running site, then start the new site.
- Stop the website if it is running (bad things happen if you don’t!). Then type:
adsutil.vbs DELETE W3SVC/x
Where x is the number of the site you want to delete.
You can find the number for an existing web site in IIS Manager by enabling logging and examining the logging properties. The web site number is at the bottom of the logging dialog.