Saturday, January 3, 2009

Change Default Virtual directory in sharepoint

One of the most common configuration inconsistencies I find in SharePoint farms is the Web application path, in most scenarios the Web applications are provisioned under the default root path of C:\Inetpub\wwwroot\wss\VirtualDirectories. This is usually the result of oversight during the provisioning process.

Windows SharePoint Services 3.0 provides a configuration field (see screenshot) that allows administrators to configure the path to the Web application host directory; however, in many cases, this setting is overlooked. Unfortunately, once a Web application has been provisioned, the only reliable method of moving the Web application is to delete and recreate the Web application on the server farm.

Windows SharePoint Services 3.0 derives the directory information from the Web server registry setting at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\PathWWWRoot, this path is subsequently appended with \wss\VirtualDirectories. To ensure Web applications are provisioned on the proper disk volume, modify the Registry values later in this post on your Web front-end computers to reference the desired path. This can be modified either prior to or after Windows SharePoint Services 3.0/Microsoft Office SharePoint Server 2007 has been installed; however, any pre-existing Web applications will not reflect the path change (see above).

A Microsoft Internet Information Services best practice is to avoid using the default path (c:\inetpub\wwwroot) and moving Web content to a non-system directory. By configuring the WWWRoot default path it provides a safeguard for oversight and promotes consistency across Web servers.

Configure the WWWRoot Default Path (Windows Server 2003)

1. Click Start, and then select Run…
2. In the Open field enter Regedit and click OK.
3. Locate the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp key and modify the PathWWWRoot Value data to D:\Inetpub\vroots.
4. Locate the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\ContentIndex\Catalogs\Web key and modify the Location Value data to d:\inetpub.
5. Locate the HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\ContentIndex\Catalogs\Web key and modify the Location Value data to d:\inetpub.
6. Locate the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ContentIndex\Catalogs\Web key and modify the Location Value data to d:\inetpub.
7. Repeat steps 1 through 6 on each Web front-end and application server.

Some of the Registry keys in the steps above may not be available on all Web servers depending on configuration and Operating System versions. Always backup the registry before modifying any Registry settings.