Setting Home Directories

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

Each Web site must have a home directory. The default Web site home directory is LocalDrive:\Inetpub\Wwwroot. You can change a Web site home directory using IIS Manager or by editing the MetaBase.xml file directly. Both methods are described in this topic.

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

Procedures

To change the home directory of a Web site using IIS Manager

  1. In IIS Manager, expand the local computer, expand the Web Sites directory, right-click the Web site you wish to change, and click Stop.

  2. Use Windows Explorer, to rename the LocalDrive:\Inetpub\Wwwroot directory to the name of your choice. Alternatively, you can copy the entire \Wwwroot directory tree to a new location.

  3. In IIS Manager, right-click your Web site, and click Properties.

  4. Click the Home Directory tab, and under The content for this resource should come from, click A directory located on this computer, A share located on another computer, or A redirection to a URL, depending on where your home directory is located.

  5. In the Local path box, type the path name, share name, or URL of your directory.

    Note

    If you select a directory on a network share, you might need to enter a user name and password to access the resource. IUSR_computername is the default account used if another account is not specified. If you use an account with administration credentials on the server, clients can gain access to server operations. This seriously jeopardizes the security of your network. For more information about security user rights see, "Security Best Practices" in Help and Support Center for Windows Server 2003.

  6. In IIS Manager, expand the Web Sites folder, right-click the Web site you just changed, and click Start.

To change the home directory of a Web site by editing the MetaBase.xml file

  1. In IIS Manager, expand the Web Sites folder, right-click the Web site you wish to change, and click Stop.

  2. Use Windows Explorer to rename the \Wwwroot directory to the name of your choice. Alternatively, you can copy the entire \Wwwroot directory tree to a new location and then rename the directory.

  3. From the systemroot\System32\Inetsrv directory, open the MetaBase.xml file in a text editor.

  4. To change the Web home directory, search for "/W3svc/1/root" and change the Path= value to the new location of the Web home directory. Substitute the value 1 with the value corresponding to the Web site to change.

  5. In IIS Manager, expand the Web Sites folder, right-click the Web site you've just changed, and click Start.