Chapter 2: The WWW Service

The WWW service, the most widely used service in the IIS suite, serves up web pages. This chapter covers the options available for a web site at the site, directory, and file levels. It tells you how to use the WWW service to set up a web site of your own.

Using the IIS MMC

First, you need to get familiar with the IIS Microsoft Management Console (MMC) snap-in. Open the IIS MMC by choosing Start | Administrative Tools | Internet Information Services (IIS) Manager. From the MMC, you can configure all the IIS components you have installed. Web sites are configured through the Web Sites folder in the left pane of the MMC. When you click to expand the Web Sites folder, you'll see a list of all the web sites on this server, and basic information about each site will appear in the right pane, as shown in Figure 2-1.

click to expand
Figure 2-1: Web sites in the IIS MMC

Web Site Directories

When you click a web site in the left pane of the MMC, a listing of all the files and directories on that site will appear in the right pane. You can navigate in the MMC as you would in Windows Explorer. You can also access the NTFS permissions for a directory here. You cannot, however, configure any of the NTFS permissions for files. The MMC allows you to see what files are available in the configured directories.

Web Site Identifier

The first site is the Default Web Site. Each site has a randomly generated identifier associated with it, and the Default Web Site's identifier is always 1. This identifier is used in the metabase configuration file to reference this site, and any programmatic interfaces-such as Windows Management Instrumentation (WMI) and Active Directory Scripting Interface (ADSI)-will use this same identifier.

Web Site Service Controls

The Windows service that web sites run in is called the World Wide Web Publishing Service. This service controls all the web sites on the server, and if it is stopped, all web sites are stopped. You can also stop, start, and pause individual web sites on a server from the MMC.

To start, stop, or pause a site, you click the site, and then use the toolbar buttons that correspond to the actions you wish to perform. These toolbar buttons look like the play, stop, and pause buttons you see on a VCR or DVD player. The State column in the right pane of the MMC displays whether a site is running, stopped, or paused:

  • Running The web site is currently enabled.

  • Stopped This web site is not serving clients and will not respond to requests.

  • Paused The web site is not accepting new requests. Processes that existed before the web site was paused will conclude, and then end. This is useful if you want to stop the site but not cut off clients abruptly.

Addressing for Sites

Each site that is running needs to have a unique address associated with it. Three types of addressing are available, and only one of the three of the addresses needs to be unique. You can decide which one of the following three is unique:

  • Host header value

  • IP address

  • Port number (not the SSL port; this doesn't count)

We'll cover how to configure these settings in the 'Setting up an Address for Your Web Site' section later in this chapter. If you attempt to start a web site that does not have a unique address in one of these three types of addressing, you will receive an error message.

Creating Virtual Directories

In addition to physical directories, you can also configure a virtual directory in the MMC. Virtual directories allow you to point a client to another directory, Uniform Resource Locator (URL), or even a share on another machine, and the directory appears to the client to be just another directory.

Creating a virtual directory is a straightforward process:

  1. Open the IIS MMC by choosing Start | Administrative Tools | Internet Information Services (IIS) Manager.

  2. In the left pane of the IIS MMC, highlight the web site or directory under which you want the virtual directory to be created.

  3. Choose Action | New | Virtual Directory.

  4. The Virtual Directory Creation Wizard will open. Click Next.

  5. In the Virtual Directory Alias dialog box, type in the alias, or name, that you want to use for this virtual directory. This is the name clients will use when accessing this directory. Click Next.

  6. In the Web Site Content Directory dialog box, type in or browse to the path that you want to use for this site. If you want to redirect to a URL, choose any path here-you can change it later if you need to. Click Next.

  7. In the Virtual Directory Access Permissions dialog box, choose the level of permissions you wish to enable for this virtual directory. Your choices are Read, Run Scripts, Execute, Write, and Browse. Click Next.

  8. Click Finish to exit the wizard.

Saving a Web Site Configuration to a File

When you have configured a web site the way you want it, you can save that web site's configuration to a file. The file is a metabase XML (eXtensible Markup Language) configuration file. By saving, you can create other sites just like this one on other servers without having to reconfigure all the options. You can also save virtual directories, File Transfer Protocol (FTP) sites, and application pools.

  1. In the IIS MMC, highlight the site that you want to save.

  2. Choose Action | All Tasks | Save Configuration To A File.

  3. In the Save Configuration To A File dialog box, type in the name of the file you wish to use.

  4. Type in or browse (by clicking the Browse button) to the location to which you wish to save this configuration.

  5. Choose whether or not you want to encrypt the export file. Since this is an XML metabase file, information may be included here that you don't want others to see or access, so encryption might be a good idea.

  6. If you choose to encrypt the configuration, choose a password to protect the encrypted contents.

  7. Click OK.

Creating a New Site

You can create many sites on a server, as long as each site is unique. To create a new site, you can use the Web Site Creation Wizard or use a file you've saved from another site.

Here's how to create a site using the Web Site Creation Wizard:

  1. Highlight Web Sites in the left pane of the MMC.

  2. Choose Action | New | Web Site.

  3. In the Web Site Creation Wizard, click Next.

  4. Type in the description of the site you want to create. This should be a friendly name (a descriptive name that means something to you) so that you can easily identify the site in the MMC.

  5. Enter the IP Address, TCP Port, and (optionally) the Host Header Name for this site. The value (All Unassigned) will configure this site to use any IP address that is not specifically used by another site. Only one (All Unassigned) site can be running on a Transmission Control Protocol (TCP) port at one time.

  6. Click Next.

  7. Type in or browse to the directory you want to use for this site. (You should have created this directory ahead of time; you can't do it from here.)

  8. Check whether or not you want to allow anonymous access to your site. Click Next.

  9. Choose the level of permissions you wish to enable for this web site. Your choices are Read, Run Scripts, Execute, Write, and Browse.

  10. Click Next, and then click Finish to exit the wizard.

If the site has an addressing conflict with another site, you will still be allowed to create the site, but it will not start.

Here's how to create a site using a file:

  1. Highlight Web Sites in the MMC left pane.

  2. Choose Action | New | Web Site (From File).

  3. In the Import Configuration dialog box, type in or browse to the file that contains the configuration you wish to use.

  4. Click Read File to see the configuration for that file. The configuration description will appear in the Location section below.

  5. In the Location section, highlight the configuration you wish to import, and then click OK.

  6. If this site already exists, you will be prompted to create a new site or replace the existing one.

  7. If you choose to create a new site, it will have the same name and configuration, but a different Identifier number.

  8. Click OK to create the site and exit.

Accessing Configuration Tabs

To access properties and configuration tabs for global web sites, web sites, directories, or files shown in the left pane of the MMC, right-click the object in the left pane, and then choose Properties. You'll see a Properties window appear.

Configuration tabs are located in the Properties window for each of these hierarchies. This chapter steps through the tabs found at each hierarchical level, starting with the web site level, since that's the level that has most of the tabs in it, and the one you generally use most.




IIS 6(c) The Complete Reference
IIS 6: The Complete Reference
ISBN: 0072224959
EAN: 2147483647
Year: 2005
Pages: 193

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net