IIS Informant - 14 Oct 1999
Questions and answers on IIS.
October 14, 1999
My company hosts a couple hundred Web sites as a Web farm. Trying to find a customer's Web site among the hundreds is frustrating. How can I sort the list of virtual Web sites in Internet Service Manager (ISM)?
When I first read this question, I thought there had to be a way to sort Web sites because it seems like such a simple notion. However, I found out that my first impression was wrong.
When you create a Web site, IIS assigns the site an instance number in the metabase. ISM lists Web sites in instance-number order (i.e., the order in which you created the Web sites). You can't change this order via the user interface (UI), and I haven't found any third-party utilities that perform this task. Although you can change the instance numbers programmatically, the IIS support staff at Microsoft insists that programmatically changing the numbers is a bad idea. Evidently, you can't resequence Web sites without recreating the virtual Web sites.
Fortunately, this situation will change with Windows 2000 (Win2K) Web services (i.e., IIS 5.0). With IIS 5.0, you can list the Web sites in sequences other than instance-number order. Until IIS 5.0 is available, however, you might consider using IIS's Web-based administration capability (i.e., the Hypertext Markup Language Administrator—HTMLA) and search for the desired site with Microsoft Internet Explorer (IE).
How can I replicate a site across several servers?
IIS doesn't have a replication feature. However, you can use Microsoft Site Server's Content Replication to replicate a site across several servers.
I have one domain with three Windows NT servers (a PDC, BDC, and member server). For illustration purposes, let's call the domain BUYPRODUCTS. Each server has unique content and has IIS with FTP installed. If JoeB logs on with a domain account and tries to access FTP on the member server, he receives the error message 530 User JoeB cannot log in. Login failed. But if JoeB logs on as BUYPRODUCTSJoeB, he can access FTP on the member server. In other words, if users don't include BUYPRODUCTS, they can't log on to the FTP server because the server validates the accounts against its local (i.e., member server) user database. How can I make the FTP server validate against the domain controller accounts instead of its local accounts?
You can use two methods to set the domain that the FTP server uses to log on. The first method uses Windows Scripting Host (WSH):
Open an MS-DOS session.
Change the directory to %windir%system32inetsrvadminsamples. (The windir directory is usually winnt.)
Type cscript //h:cscript.
Type the following command, replacing "Domain" with your domain's name (include the quotes):
adsutil set msftpsvc/DefaultLogonDomain "Domain"
Stop and restart the FTP service.
The second method is useful if you don't have WSH:
Copy mdutil.exe from the NT 4.0 Option Pack CD-ROM to the %windir%system32 directory.
Open an MS-DOS session, and change the directory to %windir%system32.
Type the following command, replacing Domain with your domain's name (don't include the angle brackets or quotes):
mdutil set msftpsvc/DefaultLogonDomain -utype ut server -dtype string -value Domain
Stop and restart the FTP service.
When setting up redirection for a Web site, I always select The exact URL entered above check box to send the client to a specified URL, as Screen 1 shows. How does this redirection differ from selecting the check box A permanent redirection for this resource?
If you select The exact URL entered above check box, you redirect all requests made to any file in the virtual directory. For example, suppose you want to redirect all requests to the Newinfo virtual directory on Server1 (i.e., \Server1Newinfo) to the Latestinfo directory on Server2 (i.e., \Server2Latestinfo). To set up the redirection, select the Home Directory page from Virtual Directory, Properties. Select A redirection to a URL. Type http://Server2/Latestinfo in the Redirect to box and select The exact URL entered above check box. Now, IIS will redirect not only all requests coming to http://Server1/Newinfo but also any requests such as http://Server1/Newinfo/Schedule.htm to http://Server2/Latestinfo. Thus, if you select The exact URL entered above check box, all requests point a virtual directory or Web site to one location. When this type of server redirection occurs, the server responds to the browser with the status code 302 Temporary Redirect.
If you select the check box A permanent redirection for this resource, you achieve the same result (i.e., all requests to a virtual directory or Web site go to one location), but the server reports the status code 301 Permanent Redirect. What's the difference between the 301 and the 302 status code? The IIS documentation reports that the 301 code not only redirects the request but also is the signal to permanently change URLs such as bookmarks on "some browsers."
When I saw the phrase "some browsers" instead of IE, I wondered what Microsoft meant, so I conducted a quick redirection test in IE 5.0. I created a bookmark to a Web site on my server, permanently redirected the Web site, and then used the bookmark to access the Web site. After hitting refresh, the redirect occurred, but the bookmark didn't change on the browser. Thus, I assume the phrase "some browsers" means some non-Microsoft browsers. So, the only difference between 301 and 302 code is that the 302 code, unlike the 301 code, doesn't signal the permanent change of URLs (e.g., bookmarks) on non-Microsoft browsers when you redirect requests.
When you're redirecting requests, you can use not only an absolute URL path but also variables and syntax in the Redirect to box. Using variables and syntax gives you more flexibility. For example, you can use the same entry to redirect calls for an Active Server Pages (ASP) file to one location and calls for a Common Gateway Interface (CGI) file to another location. Table 1 provides the redirection variables that you can use.
You can also use syntax to redirect calls for ASP files to one location and calls for HTML files to another location. Here are the rules for syntax redirection.
The first character in the Redirect to box must be an asterisk (*).
You must separate arguments with a semicolon (;).
You must select The exact URL entered above check box.
For example, the entry in Screen 1's Redirect to box routes all calls for an ASP file to default.asp and all calls for an HTML file to default.htm.
Using syntax to redirect requests is simple. However, you need to know about one possible pitfall. If a browser requests a page that's also the target of the redirection, a loop occurs. For example, if the browser requests xyz.htm and you're redirecting all .htm requests (which includes requests for xyz.htm), a loop occurs. To prevent default.htm (and other pages in the same situation) from being redirected, go to the individual file (in this case, default.htm) and place an exclamation point (!) in the Redirect to box.
All my users require access to the FTP server. When they authenticate, the FTP server places them at the FTP server's home directory. How can I change the system so that the FTP server places users in their folders after they log on?
To change the location, select the FTP server you want to use. Create a virtual directory, giving it a user's name. Repeat this process for every user. If you have many users, you can automate this task with Active Directory Service Interfaces (ADSI) objects and the CreateVirtualFTPdir script in the Microsoft Windows Internet Information Server Resource Kit. After you create a virtual directory for each user, turn off anonymous access. Now when users authenticate, the FTP server automatically moves them to their personal virtual directory.
About the Author
You May Also Like