IIS Insider - September 2003

By Brett Hill

PDF Files Do Not Render Properly

Q: Our IIS 5 server hosts an Internet site we use to deliver Adobe Reader (also known as Adobe Acrobat') pdf files. Normally, you would expect the files to download and then open the reader to render the file; however, the files do not open or the reader opens but does not show anything. Is there some IIS setting that needs to be configured in order to for the files to render properly?

A: I've encountered some problems from time to time with .pdf files as well. Here are some suggestions from IIS admins on steps they've taken to render .pdf files correctly.

  • If you "enable content expiration" on the HTTP Headers, then add the following MIME type:

    Associated Extension: .pdf

    Content Type (MIME): application/pdf
  • Regenerate the pdf without FastWeb View enabled: Prefs > General > Options > Allow Fast Web View in the reader
  • Download the file to the client's disk, and then open it.
  • Disable Web Browser Integration:
    1. In Acrobat or Adobe Reader, choose Edit > Preferences > Internet.
    2. Deselect Display PDF in Browser, and then click OK.
  • Be sure the client is using Internet Explorer 5.5 or greater.
  • Check the local cache for Internet Explorer (Tools, Internet Options, Temporary Internet Options, Settings) and make certain this cache is large enough for the largest of your downloaded pdf files.
  • Disable the Document Footer feature, if in use
  • Drag a downloaded .pdf file into an open Internet Explorer window. This can invoke a configuration validation for the reader that may help reset some values.

In some cases, the download will work on some systems and not others. If this is the case, then do a network capture from both systems. In most cases, if the capture is identical, the problem is most likely an installation problem with the Reader.

Adobe, Acrobat, and Reader are copyrights of Adobe Systems Incorporated.

How to Monitor the Recycling of Application Pools

Q: We're using IIS 6 and are very impressed with the results so far. I've noticed that when Application Pools recycle, there isn't a record of events kept in the logfiles or event viewer. Is there some way to monitor when a recycle occurs?

A: In order to record the various events that can trigger a recycle, you have to make metabase entries corresponding to those events. The metabase property is LogEventOnRecycle located in the Metabase path /LM/W3SVC/AppPools or placed in the entries for the individual application pools.

The following table from the IIS 6 Resource Kit, Chapter 24 (http://www.microsoft.com/downloads/details.aspx?FamilyID=80a1b6e6-829e-49b7-8c02-333d9c148e69&DisplayLang=en) shows you the entries to make and to which events they correspond.

Recycle Condition Event ID Metabase Property Bitmask
Elapsed time 1074 AppPoolRecycleTime 1 (0x1)
Number of requests processed 1075 AppPoolRecycleRequests 2 (0x2)
Scheduled recycle 1076 AppPoolRecycleSchedule 4 (0x4)
Virtual memory consumed 1077 AppPoolRecycleMemory 8 (0x8)
ISAPI reported itself unhealthy 1078 AppPoolRecycleIsapiUnhealthy 16 (0x10)
Recycled on demand 1079 AppPoolRecycleOnDemand 32 (0x20)
Recycled due to configuration change 1080 AppPoolRecycleConfigChange 64 (0x40)
Private memory consumed 1117 AppPoolRecyclePrivateMemory 128 (0x80)

You can enter these properties using a bitmask value for LogOnEventRecycle, but you can also add them individually. Below is an example showing the AppPoolRecycleOnDemand property using MetaBase Explorer.

If your browser does not support inline frames, click here to view on a separate page.

How to Remove the Administration Web Site

Q: In reviewing the configuration of our IIS 5 servers, we decided to remove the Administration Web Site since we don't use it. When we right click on the web site, the Delete option does not appear. How can we remove the site if there is no Delete option? Since Microsoft does not allow you to delete, does this mean we shouldn't?

A: There is a property in the metabase called NoDelete that can be set for a web site. When enabled, the Delete option is removed from the list of choices when you right click on the web site. By default, this option is enabled for the Administration Web Site, meaning that you cannot delete it from the Internet Information Services snap-in like you can other web sites. You should not misconstrue this to mean that you should not remove it if it's not in use.

There are numerous other means to remove the web site:

  • Select Add/Remove Programs, Add/Remove Windows Components, then select Internet Information Services (IIS) and click Details. Clear the check box next to Internet Services Manager (HTML) and click OK, then Next.
  • Use MetaEdit to delete the Administration Web Site. This will normally be web site number 2, but be sure to check the Server Comment property to make certain.
  • Save the following script as a .vbs file and run it.
WScript.Echo "This script will delete the Administration Web Site" Set objIISW3SVC = GetObject("IIS://localhost/W3SVC") For Each Site in objIISW3SVC If Site.Class = "IIsWebServer" Then Set objIIsWebSite=GetObject(Site.ADsPath) If objIIsWebSite.Get("ServerComment") = "Administration Web Site" Then objIISW3SVC.Delete "IIsWebServer", Site.Name WScript.Echo objIIsWebSite.Get("ServerComment") & "has been deleted." End If End If Next

Submit your questions to the IIS Insider. Selected questions along with the answers will be posted in a future IIS Insider column.

For a list of previous months questions and answers on IIS Insider columns, click here.

We at Microsoft Corporation hope that the information in this work is valuable to you. Your use of the information contained in this work, however, is at your sole risk. All information in this work is provided "as is," without any warranty, whether express or implied, of its accuracy, completeness, fitness for a particular purpose, title or non-infringement, and none of the third-party products or information mentioned in the work are authored, recommended, supported or guaranteed by Microsoft Corporation. Microsoft Corporation shall not be liable for any damages you may sustain by using this information, whether direct, indirect, special, incidental or consequential, even if it has been advised of the possibility of such damages.