Implementing Incremental Web Site Numbering

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

In IIS 5.1 and earlier, IIS-generated Web site numbers incrementally. The first site was numbered 1, the second site numbered 2, and so on. Beginning with IIS 6.0, the default numbering scheme has changed. Upon installation of IIS 6.0, IIS generates a default Web site that is numbered 1. IIS then generates the Web site identification number, based on a hash of the site name, for any additional sites that you create.

You can retain the incremental numbering scheme of IIS 5.1 and earlier. This might be preferable if you have existing scripts, applications, or logging tools that rely on incremental site numbering.

See "Related Information" at the end of this topic for links to specific step-by-step procedures related to the general steps described.

Important

This topic contains information about modifying the registry. Using Registry Editor incorrectly can cause serious problems that require reinstalling the operating system. Because Registry Editor bypasses the standard safeguards that prevent you from entering settings that are conflicting or likely to degrade performance or damage your system, exercise caution when making changes to the registry. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. For information about how to edit the registry, see the "Changing Keys and Values" topic in Registry Editor Help.

Procedures

Implementing Incremental Web Site Numbering on an Existing IIS 6.0 Installation

  1. Enable incremental Web site numbering on your production IIS 6.0 server and on a staging IIS 6.0 server.

  2. Export the entire metabase from the production server and import this metabase to the staging server.

  3. Enable the metabase edit-while-running feature on the staging server, and then stop the World Wide Web Publishing service (WWW service).

  4. Open the MetaBase.xml file on the staging server in Notepad or another plain text editor.

  5. Find the first Web site that you want to renumber in the MetaBase.xml file. Perform a search-and-replace through the entire metabase, replacing every occurrence of the original Web site number with the incremental number that you want to assign to the site. Repeat the search-and-replace pass for all Web sites, incrementing each successive Web site number by 1.

  6. Save the MetaBase.xml file and restart the WWW service.

  7. Test your sites and Web applications by requesting content from each of them. If any failures occur, identify the cause and correct it. Most failures will likely result from leftover references to the original Web site number.

  8. Disable edit-while-running (once debugging is complete), test the sites again for functionality, and then export the entire metabase from the staging server and import it onto the production server.

  9. Restart the WWW service on your production server and then validate functionality by making a request to the home page of your main site.

Important

If you want to use incremental site numbering in IIS 6.0, it is best to enable incremental site numbering immediately after installing IIS 6.0, and before creating any new Web sites. This avoids the possibility of accidentally creating new Web sites with numbers out of sequence.

Notes

  • Enabling incremental Web site numbering does not change the identification number of existing sites.

  • If your server already contains Web sites that were created by using the IIS 6.0 default numbering scheme, and you enable incremental Web site numbering, the next site created will be numbered with the first unused incremental number. For example, if you enable incremental site numbering on a server with existing sites numbered 1, 2, 3, and 10, the next site number will be 4.

  • When remotely administering a server running IIS 6.0 with incremental site numbering enabled, make sure that the server from which you are performing the remote administration also has incremental site numbering enabled. This is necessary because the value of the IncrementalSiteIDCreation registry entry on the system from which you are performing the administration determines how site identification numbers are generated on the IIS server being administered.