Simon Gibson

Site Search:
ASP.NET Search for Index Server ASP.NET Suche für den MS/Indexdienst ASP Search for Index Server ASP Site Search for IIS web sites

Creating a Virtual Directory to access Network Resources
(Windows 2000 Server, Windows Server 2003)

Overview:
This tutorial explains the steps required to add a Virtual Directory to your web site or Intranet.

What is a Virtual Directory?
A Virtual Directory is a directory within a web site that links to another directory. This link can be to directory on the local server or network share.

Why is this useful?
A Virtual Directory can be useful if you need to include existing files within a web site or Intranet but are not able to move or copy them beneath the physical site root. Virtual Directories are particularly useful when used in conjunction with Microsoft Indexing Services as files on Network shares can be indexed and made available for searching - this can potentially allow users to search for files across multiple network shares without the need to reconfigure UNC shares or server roles.

 
 

1. Add a Virtual Directory from within Computer Management:
To open computer management, right click on 'My Computer' and select 'Manage'. If you are using the new-style start menu click 'Start' then right-click on 'My Computer' and select 'Manage'.

Expand 'Internet Information Services (IIS)' by clicking on the plus next to it, then expand 'Web Sites' and the web site you want to add a Virtual Directory to.

Next, right-click on the name of the web site and select 'New' and 'Virtual Directory' as shown in Figure 1 above.

 
 

 
 

Figure 2

2. The Virtual Directory Creation Wizard:
Once you have completed the previous step, you will be presented with the 'Virtual Directory Creation Wizard' - press 'Next' to start.

 
 

 
 

Figure 3

3. Virtual Directory Alias:
Enter the name (Alias) for the virtual directory. This is the name that will be used to access the Virtual Directory from your web site. Press 'Next' to continue.

 
 

 
 

Figure 4

4. Web Site Content Directory:
In this case, we are linking our Virtual Directory to a Network Share called 'sales' on a file server, 'fs1'. You could, of course, enter your own Network Share or local directory. Press 'Next' to continue.

 
 

 
 

Figure 5

5. User name and password for accessing Network resources:
If you are adding a local directory as a Virtual Directory you should skip this step as you will not be prompted for a user name and password. Press 'Next' to continue.

If you are adding a Network Share as a Virtual Directory then you should supply the user name and password of an account that has the necessary permissions to access the share.

Windows Server 2003 has an additional checkbox (shown above) which allows the credentials of the current user (IUSR_SERVERNAME if your site uses anonymous access) to be used when accessing Network Resources. You may want to consider enabling this feature if your site uses Integrated Windows Authentication but not if you are using Anonymous access.

Press 'Next' to continue.

 
 

 
 

Figure 6

6. Virtual Directory Access Permissions:
Next, set the IIS permissions for this directory. In almost all cases, you should limit this to 'Read' only. However, 'Browse' may also be useful in some situations. Press 'Next' to continue.

 
 

 
 

Figure 7

7. Completing the Virtual Directory Creation Wizard:
The Wizard is now complete and the Virtual Directory has been added. Click 'Finish'.

 
 

 
 

Figure 8

8. The new Virtual Directory within the web site tree:
You will notice that the Virtual Directory now appears in the web site tree as it's 'Alias'. Virtual Directories are identified by a folder with a Globe or by a cog wheel icon if they are also configured as an Application. See section 9 below for more information on icon types.

The Virtual Directory can be accessed via it's 'Alias' (eg. http://intranet/sales/) using a web browser.

 
 

 
 
Figure 9a Figure 9b
Windows XP/2000 Pro/Server
Windows Server 2003

9. A note on types of IIS directories:
The image above illustrates the three icons (four with Windows XP/2000) you may come across when working with IIS.

Application: This icon represents either a physical directory or virtual directory that has been enabled as an Application using the IIS management console.

Virtual Directory: This icon represents a Virtual Directory - a directory or subdirectory that is not physically under the web site route. A Virtual Directory can be located on the local machine or network resource.

Error (Windows XP/2000 only): This icon represents a Virtual Directory linked to a Network Resource that does not have the necessary permissions to access it. This can be caused by the Network Resource not being available, the user not having permissions to access the Network Resource or the user name and/or password not being correct.

Directory: This icon represents a physical directory or subdirectory located within the site route.

 
 
[Home] [3D Design] [Web Design] [Intranet/Extranet] [Personal]
Design and Content © Simon Gibson 2000 - 2010
[Email] [Site Map] [Search] [Privacy]
There are currently 30 users online.