IIS Home @ it-notebook.org

ISAPI filter does not load; Added MIME type, but still gets 404

(Kristofer Gafvert, October 10, 2007)

Introduction

Each week I take two questions from the IIS newsgroups (or IIS forums) that I think is of public interest, and I answer them here as well. Questions and answers may be modified to be more general and more useful for everyone.

ISAPI filter does not load

I have installed an ISAPI filter (URLScan), but it does not seem to be installed correctly. From the properties of the web site, I clicked on the ISAPI Filters tab, clicked Add and entered all necessary information. But once I have done that, the status does not change, which it used to do in IIS 5.0

On IIS 6.0, when you install an ISAPI filter on site level, it will load on the first request. This is different to IIS 5 where the filter was loaded dynamically as soon as it was added to the web site. So once you have sent a request to the web site, the status of the ISAPI filter will change to either Loaded (green arrow) or Not Loaded (red arrow).

As a side-note, if you install a global ISAPI filter (for all websites), you need to stop and restart the Web server to load the filter into memory.

Added MIME type, but still gets 404

I have added .java to the list of MIME types because I want people to be able to download these files. Despite this, IIS will not serve the .java-file, and I get a 404 status code returned. Why?

In this case, we need to look in the log file to get more information. We need to know the sub status code and sc-win32 status code. The log file is located in %windir%/system32/logfiles/w3svcNNN where NNN is the website ID.

From questioner: The sub status code is 2 and the scwin32 status code is 1260.

The sub status code 2 tells us that you have added a script map for the .java extension (but not enabled a web service extension). So what is happening is that IIS tries to execute the .java-file on the server, but cannot do so because the web service extension is not enabled. This results in a 404.2, which means "Denied due to Lockdown Policy". This is basically also what 1260 tells us, which in clear text is "Windows cannot open this program because it has been prevented by a software restriction policy." (to see this, type "net helpmsg 1260" in a command prompt).

To solve this, and allow visitors to download .java-files, you need to remove the script map. To do that:

  • In IIS Manager, right click the website (or a folder, or the web server itself, depending on where you have set the script map) and click Properties
  • Click on the Home Directory tab
  • Click on the Configurations button
  • Remove the .java extension from the list of Application extensions

Applies to [?]

IIS 6.0

Resources

Installing ISAPI filters