CHAPTER 6
Planning Your Content Directories and Virtual Servers
On small Web sites, Web content files are usually contained under one directory tree. Larger Web sites often store HTML content files, Web applications, and databases in multiple directories on the same computer or on several computers in the network. To make the contents of directories that reside on other computers appear in your computer's Web site, you create virtual directories.
With Internet Information Server, you can also create virtual servers, which enable a single server to appear as several servers. You can associate each content directory with a specific virtual server.
This chapter explains how to:
If no default document is available, the WWW service will return an error, unless directory browsing is enabled. If directory browsing is enabled, a directory listing containing links to the files and folders in that directory will appear.
A default document can be included in all WWW directories. In the Directories property sheet for the WWW service, change the Default Document entry to the default file name you will use on your system. Often the default document is set to be an index file (Index.htm) for the contents of that directory (or of the entire Web site). The default file name used is Default.htm.
If the user does not specify a file for a particular directory, a hypertext file and directory listing will be returned.
Directory browsing on the WWW service is very similar to browsing in File Transfer Protocol (FTP). Directory browsing is useful if you have a lot of files that you want to share quickly without converting them to Hypertext Markup Language (HTML) format.
Note Virtual directories will not appear in directory listings (also called directory browsing for the WWW service). To access a virtual directory, users must know the virtual directorys alias, and type the URL in the browser. For the WWW service, you can also create links in HTML pages. For the gopher service, you can create explicit links in tag files so that users can access virtual directories. For the FTP service, you can list virtual directories by using directory annotations.
To do this, you must obtain Internet Protocol (IP) addresses from your Internet Service Provider (ISP) for the primary server and for each virtual server you want to create. For example, you assign the first IP address (10.212.56.184) in the Domain Name System (DNS) as www.company.com (your primary server), and assign C:\Wwwroot as its content home directory. You register the second IP address (10.212.56.185) in the DNS as marketing.company.com, and assign a different drive or directory as its content home directory. Thus, it appears to users on the Internet that there are two computers when in fact it is the same computer running one copy of the WWW service. If you create a home directory without specifying an IP address, that home directory will be used for all requests containing server IP addresses not specified in other home directories.
These multiple IP addresses can be assigned to multiple network adapter cards, or to a single card. You use the Network application in the Windows NT Control Panel to bind the additional IP addresses to your network adapter card.
After the IP address is assigned to the network adapter card, you must assign a home content directory to that IP address. In the Directories property sheet, select the Virtual Server box and enter its IP address. Virtual directories (directories that are not home directories) can also be restricted to one virtual server by assigning an IP address to them.
2. Click the Directories tab.
3. Click the Add button.
4. In the Directory box of the Directory Properties dialog box, select a directory by clicking the Browse button.
5. Click Home Directory.
6. Select the Virtual Server check box.
7. Type the IP address for the virtual server.
Directory lists the physical location of the directory.
Alias is the path for information service users.
Address lists the IP address of virtual servers assigned to that directory.
Error indicates any error status.
To configure individual WWW service directories, in the Directories property sheet click the Add button or the Edit Properties button.
Every service must have a home directory. The home directory is the root directory for that service. A root directory does not have a name. By default, the home directory and all folders in it are available to users.
2. Click the Directories tab.
3. In the Directory list, select the directory with the <home> alias.
4. Click Edit Properties.
5. In the Directory box, type the name of the new directory, or select a new directory by using the Browse button.
6. In the Access box, select the access that you want to give users who connect to that directory.
7. Click OK.
8. Click Apply and then click OK.
2. Click the Directories tab.
3. Click Add.
4. In the Directory box, type the name of the new directory or select a new directory by using the Browse button.
5. In the Access box (if applicable), select the access you want to give users who connect to that directory.
6. Click OK.
7. Click Apply and then click OK.
2. Click the Directories tab.
3. In the Directory list, select the directory you want to delete.
4. Click Remove.
5. Click Apply and then click OK.
Note Deleting a virtual directory does not delete the directory or files to which the virtual directory points.
One (or more, if multiple virtual directories are active) of the directories listed on the Directories property sheet is marked as a home directory (sometimes referred to as a root directory). The path used in a client request to refer to the home directory is a forward slash (/). When a client request contains a path of /, or does not specify the path to a resource, the Web server looks in the defined home directory for the resource. For example, all of the following URLs refer to the Web servers home directory.
http://inetsrvr.microsoft.com/
http://inetsrvr.microsoft.com/content.htm
The action taken by the Web server for the first two URLs shown above depends on the settings of the Default Document and Directory Browsing options, specified on the Service property sheet of Internet Service Manager. For the third example, the HTML file Content.htm, located in the home directory, is sent to the client. If a file by that name does not exist in the home directory, the server returns an error to the client. Other directories are not searched for such a file.
When a client logs on to the FTP service, the service looks for a subdirectory under the specified home directory with the name of the user logging on. For anonymous FTP logons, the service looks for a directory called anonymous under the home directory. If such a directory exists, the user will start the session with it as the current directory. If such a directory is not found, the current directory will be the home directory.
Subdirectories of the home directory are accessible to clients. For example, if a WWW service is configured with a home directory of C:\Wwwroot, then the following URL:
causes the Web server to look for a file by the name content.htm in the directory C:\Wwwroot\Data. If the Data subdirectory does not exist, or the file is not found in that directory, the server will return an error. The FTP service allows changing the current directory to subdirectories of the home directory (by using the cd command), and gopher selectors can refer to objects in subdirectories of the home directory.
To simplify client URL addresses, the services present the entire set of publishing directories to clients as a single directory tree. The home directory is the root of this virtual directory tree, and each virtual directory is addressed as if it were a subdirectory of the home directory. Actual subdirectories of the virtual directories are available to clients as well. The WWW service alone supports virtual servers; thus, the FTP and gopher services can have only one home directory.
Note Virtual directories will not appear in directory listings (also called directory browsing for the WWW service). To access a virtual directory users must know the virtual directorys alias, and type the URL in the browser. For the WWW service, you can also create links in HTML pages. For the gopher service, you can create explicit links in tag files so that users can access virtual directories. For the FTP service, you can list virtual directories by using directory annotations.
When a virtual directory is defined in Internet Service Manager, an alias is associated with the virtual directory. The alias is the subdirectory name that will be used by clients to access information in the virtual directory. If alias names for virtual directories are not specified by the administrator, an alias name is generated automatically by Internet Service Manager.
For example, suppose an administrator defines two directories for the WWW service as follows:
D:\Webdata Alias = data
If C:\Wwwroot contains the subdirectory C:\Wwwroot\Scripts\, and D:\Webdata contains the subdirectory D:\Webdata\Images\, the following URLs can be requested by a Web client:
http://inetsrvr.microsoft.com/scripts/query1.htm
http://inetsrvr.microsoft.com/data/stocks.htm
http://inetsrvr.microsoft.com/data/images/graph1.htm
For another example, if you want to provide three different product catalogs, each catalog could be stored on a separate hard drive on the server www.company.com.
Virtual directories can be used to present three separate drives as three subdirectories.
To browsers, virtual directories appear as subdirectories of the root home directory. You must provide the name (alias) that browsers will use to specify that directory.
Note To browse virtual directories, the URL for the virtual directory must be specified. This can be done either by clicking a hypertext link containing the URL, or by typing the URL in the browser.
2. Click the Directories tab.
3. Click Add.
4. Click Browse to select a directory in the Directory box.
5. Click Virtual Directory, then type the name of the virtual directory in the Alias box.
6. Set the Access permissions.
7. Click OK.
8. Click Apply and then click OK.
Note Virtual directories will not appear in directory listings (also called directory browsing for the WWW service). To access a virtual directory, users must know the virtual directorys alias and type the URL in the browser. For the WWW service, you can also create links in HTML pages. For the gopher service, you can create explicit links in tag files so that users can access virtual directories.
For the FTP Service, Write must be selected for directories that will accept data from users. Assign Write access cautiously to prevent unauthorized users from placing malicious files on, or deleting information from, your computer.
For the WWW service, Execute must be selected for directories containing programs, scripts, and Internet Server API (ISAPI) applications. Also, ensure that any directory marked Execute is not also marked Read; this will prevent users from seeing your interactive content executable files.
For the WWW service, Require secure SSL channel must be selected to require encrypted communication for a directory. For more information on Secure Sockets Layer (SSL), see Chapter 5, Securing Your Site Against Intruders.
© 1996 by Microsoft Corporation. All rights reserved.