Suppose you just deployed an expensive, new Web site only to discover that a company logo was omitted from all of the site's pages. Or, imagine that you are suddenly asked to route thousands of users to alternate Web sites while technicians scramble to troubleshoot a malfunctioning computer. Such issues only begin to hint at the daytoday challenges of successfully managing a Web site. And although effective Web site management ultimately depends on an administrator's skill, there are a number of basic tools and procedures that you can use to deal with most common management tasks and emergencies.
To begin with, you should set up your Web sites by indicating which directories contain the documents that you want to publish. The Web server cannot publish documents that are not within these specified directories. So, the first step in deploying a Web site should be to first determine how you want your files organized. You then use the Internet Information Services snap-in to identify which directories are part of the site.
If you want to get started right away without having to create a special directory structure and your files are all located on the same hard disk of the computer running Internet Information Services, you can publish your documents immediately by copying your Web files into the default home directory, C:\InetPub\Wwwroot. (For an FTP site, copy your files into C:\InetPub\Ftproot.) Intranet users then can access these files by typing the following URL: http://server name/file name. To learn how to host multiple sites and organize disparate Web content, see the procedures in this section. They explain such things as how to change the default location of your files and how to add directories that are located on other hard disks or on computers across the network.
Each Web or FTP site must have one home directory. The home directory is the central location for your published pages. It contains a home page or index file that welcomes customers and contains links to other pages in your site. The home directory is mapped to your site's domain name or to your server name. For example, if your site's Internet domain name is www.microsoft.com and your home directory is C:\Website\Microsoft, then browsers use the URL http://www.microsoft.com to access files in your home directory. On an intranet, if your server name is AcctServer, then browsers use the URL http://acctserver to access files in your home directory.
A default home directory is created when you install Internet Information Services and when you create a new Web site. You can change the home directory; for instructions, see Changing the Home Directory.
To publish from any directory not contained within your home directory, you create a virtual directory. A virtual directory is a directory that is not contained in the home directory but appears to client browsers as though it were.
A virtual directory has an alias, a name that Web browsers use to access that directory. Because an alias is usually shorter than the path name of the directory, it is more convenient for users to type. An alias is more secure; users do not know where your files are physically located on the server and cannot use that information to modify your files. Aliases make it easier for you to move directories in your site. Rather than of changing the URL for the directory, you change the mapping between the alias and the physical location of the directory.
For example, suppose you are setting up a Web site for your marketing team on your company's intranet. The following table shows the mapping between the physical location of the files and the URL that accesses the files.
Physical Location |
Alias | URL Path |
---|---|---|
C:\Wwwroot | home directory (none) | http://Sales |
\\Server2\SalesData\ProdCustomers | Customers | http://Sales/Customers |
C:\Wwwroot\Quotes | None | http://Sales/Quotes |
C:\Wwwroot\OrderStatus | None | http://Sales/OrderStatus |
D:\Mktng\PR | PR | http://Sales/PR |
Both virtual directories and physical directories (directories without an alias) appear in Internet Services Manager. A virtual directory is indicated by a folder icon with a globe in the corner. The following illustration shows the Web site example described above; /Customers and /PR are virtual directories:
For a simple Web site, you may not need to add virtual directories. You can simply place all of your files in the sites home directory. If you have a complex site or want to specify different URLs for different parts of your site, you can add virtual directories as needed. For instructions, see Creating Virtual Directories.
When a browser requests a page on your Web site, the Web server locates the page identified by the URL and returns it to the browser. When you move a page on your Web site, you can't always correct all of the links that refer to the old URL of the page. To make sure that browsers can find the page at the new URL, you instruct the Web server to give the browser the new URL. The browser uses the new URL to request the page again. This process is called redirecting a browser request or redirecting to another URL. Redirecting a request for a page is similar to using a forwarding address with a postal service. The forwarding address ensures that letters and packages addressed to your original residence are delivered to your new residence.
Redirecting a URL is useful when you are updating your Web site and want to make a portion of the site temporarily unavailable, or when you have changed the name of a virtual directory and want links to files in the original virtual directory to access the same files in the new virtual directory. For instructions, see Redirecting Requests to a Directory.
Often, it may be useful to dynamically alter Web content after the content has been requested, but before it gets returned to the browser. Internet Information Services includes two features that provide this functionality: serverside includes (SSI) and the Microsoft® Active Server Pages (ASP) scripting environment.
Using SSI, you can carry out a whole host of Web site management activities from adding dynamic timestamping to running a special shell command each time a file is requested. SSI commands, called directives, are added to Web pages at design time. When a page is requested, the Web server parses out all the directives it finds in a Web page and then executes them. A commonly used SSI directive inserts, or includes, the contents of a file into a Web page. So, for example, if you are required to continually update a Web page advertisement, you could use SSI to include the advertisement's HTML source into the Web page. To update the advertisement, you need only modify the file containing advertisement's HTML source. You do not have to know a scripting language to use SSI; simply follow the correct directive syntax.
For more detailed procedural and reference information, see ServerSide Includes.
ASP is a server-side scripting environment that you can use to dynamically alter Web content. Although ASP is primarily designed for Web application development, it has many features that can be used to make Web sites more easier to manage. For example, with ASP you can track users visiting a Web site, or you can customize Web content based on browser capabilities. However, unlike SSI, ASP does requires you to use a scripting language such as VBScript or JScript.
For more information, see Using ASP to Manage Web Site Content.