Project

General

Profile

Help Please!! Trying to Configure Hello Example to Work with IIS

Added by T D almost 9 years ago

I'm having difficulty getting the "Hello" example to work with IIS 7.5. I've followed the documentation at http://redmine.webtoolkit.eu/projects/wt/wiki/ISAPI_on_Microsoft_IIS multiple times. I've used depends to verify that HttpExtensionProc, GetExtensionVersion, TerminateExtension are being exported by hello.wt.dll. I also have "Allow Unspecified ISAPI Modules" checked on the "Edit ASAPI and CGI Restrictions Settings" for the machine.

What's happening is that I can use my browser to navigate to the directory where the Hello.wt.dll exists, but when clicking on it, it simply wants to download Hello.wt.dll instead of executing it. I think the problem has something to do with "Handler Mappings" in the IIS configuration. Please see the attached image. Note that I do have "Read, Script, Execute" all checked in the "Edit Feature Permissions" settings for the machine. But I think the problem might be that there is nothing "ISAPI" related in the list of "Handler Mappings". Should something more be there? If so, what should it be?

Any help with this would be greaty appreciated.

Thanks,

Terence


Replies (14)

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Wim Dumon almost 9 years ago

Hey,

In my configuration there is indeed an extra line right before the OPTIONSVerbHandler:

ISAPI-dll, *.dll, Enabled, File, IsapiModule.

I don't remember adding it there myself...

Wim.

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Wim - Hi, thanks for the quick response! I've manually added this "ISAPI-dll" entry and am now getting a little farther in that it actually appears to try and use the Hello.wt.dll DLL in execution rather than just download the file, however, it's not yet fully working. A few questions:

  1. When configuring the ISAPI "Handler Mapping" entry it appears to require an "Executable" (please see attached screenshot titled ISAPI-WT-HandlerMapping.png). I've set this to the my Hello.wt.dll. Do you think that's correct, or should it be some other executable?
  2. When browsing to http://localhost:81/hello.wt.dll I get an HTTP Error 500.0. I turned on tracing and am seeing the error "The operating system cannot run %1 (0x800700b6)". I'm not sure what this is referring to. I've included a screenshot of this titled "TraceError.png". Do you have any idea?
  3. Do you agree that the ".Net Framework Version" for the Application Pool should be set to "No Managed Code"? This makes sense to me since Wt is standard C. I've included a screenshot of this setting in the ApplicationPoolDotNetFramework.png file.
  4. Despite following the instructions and re-reading them multiple times, I'm somewhat concerned my Hello.wt.dll might not be correctly compiled. Is it possible you could send me a simple Wt DLL program that you're certain works so I could rule out that being the error?

Again, many thanks for your help!

-Terence

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Bump :) ...Still hoping to get some answers to my questions above.

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Wim Dumon almost 9 years ago

Hey TD,

1. As far as I know, I did not change the isapi handler mapping. You'll probably need a module map instead of a script map. The executable field is left empty.

  1. No, I don't think I've ever seen this error
  2. I don't know. I use the default Application pool, which lists .NET framework 2.0, pipeline mode set to 'integrated'.
  3. This is the part that held me back answering before - I need to build and test one here (need to find some time to do so)

Best regards,

Wim.

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Wim Dumon almost 9 years ago

Here's a working hello world isapi dll. Tested on Windows 7.

Wim.

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Thanks Wim for the DLL. However, despite another few hours of tinkering, it's still not working. Specifically, I think it must have something to do with the Module Mapping for the Isapi Handler. In a previous post you said this:

You'll probably need a module map instead of a script map. The executable field is left empty.

However, IIS Manager is not allowing me to do this. Please see the attached screenshot. Despite it saying that the executable field is optional it insists I should have one. It won't allow me to leave the executable field empty and still create a module mapping. Any ideas?

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Wim Dumon wrote:

Here's a working hello world isapi dll. Tested on Windows 7.

Wim.

Wim - Hi, I'm still stuck on this. A quick question: Can you provide the web.config file for when you successfully tested this hello world isapi dll? It should be in the same directory you have your hello world DLL in. I'd like to compare it to what I have.

Thanks,

Terence

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Wim Dumon almost 9 years ago

Hey terrence,

These are the contents of web.config in my wt source dir:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <directoryBrowse enabled="true" />
        <handlers accessPolicy="Read, Execute, Script" />
    </system.webServer>
</configuration>

These are the contents of web.config in my inetpub dir:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose" />
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                        <add provider="ISAPI Extension" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions statusCodes="401.3" />
                </add>
            </traceFailedRequests>
        </tracing>
        <handlers accessPolicy="Read, Execute, Script" />
    </system.webServer>
</configuration>

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Wim Dumon almost 9 years ago

T D wrote:

Thanks Wim for the DLL. However, despite another few hours of tinkering, it's still not working. Specifically, I think it must have something to do with the Module Mapping for the Isapi Handler. In a previous post you said this:

You'll probably need a module map instead of a script map. The executable field is left empty.

However, IIS Manager is not allowing me to do this. Please see the attached screenshot. Despite it saying that the executable field is optional it insists I should have one. It won't allow me to leave the executable field empty and still create a module mapping. Any ideas?

I can only say that it is empty on my system. But as far as I remember, I never added this module mapping, I believe it was a default mapping in my installation. Under 'request restrictions', in 'Mappings' tab the checkbox is checked and I selected 'File', in the 'Verbs' tab 'All verbs' is selected, and in the 'Access' tab 'execute' is selected.

I just noticed now that from the moment I modify anything (like .DLL iso.dll), I get the same error dialog as you do. Must be some weird interpretation of '(optional)' by MS?

See also http://redmine.emweb.be/boards/2/topics/12464

Wim.

Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Wim - Hi, thanks for the response. I finally was able to get it working a couple of weeks back. Through a lot of fiddling, I was somehow able to add the ISAPI DLL handler in a proper setup like yours.

From there I was getting a "failed to load file" (or something worded similar) error in my trace log. Unfortunately, the error info never tells you which file it's failing to load. After a lot of Googling, it occurred to me there may be system DLLs my Wt program DLL was attempting to load that it could not find. I used the "depends" program to see what DLLs it couldn't find. There were a few MSVC*.DLL's it needed.

So, I copied the necessary DLLs over to my D:\inetpub\test directory and the page is loading except it's missing the style sheets so the layout and etc looks quite bad. After multiple tests with both my application and the "WTreeView Drag and Drop" application on various machines I'm pretty sure it's related to IIS.

The issue seems to be as simple as: If IIS is installed on a machine, the Wt application cannot load stylesheet, controls, etc. If IIS is NOT installed on the server machine, everything works fine. Please see the attached screenshots of the "WTreeView Drag and Drop" to show what I mean.

Interestingly enough, I get the same behavior if my Wt application (or the WTreeView example application) is using IIS or the Wt built-in web server. If IIS is installed on the machine, no stylesheets and etc are loaded.

I'm curious if anyone else has experienced an issue like this and know an exact cause or solution? I've searched the forum and have not found much.

Thanks,

Terence

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Patrick ottavi almost 9 years ago

hello,

Verify that the SSI (server-side includes) is installed on your server IIS.

see my setup for my IIS server in the pdf file

Patrick.

IIS.pdf (120 KB) IIS.pdf

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Patrick - Thanks for the quick reply. Yes, I confirmed that SSI is installed. Please see the attached screenshot showing this and all other IIS settings installed. I'm configuring this to run on Windows Server 2008 R2. Are there any other settings you see which I might need to have installed or uninstalled to resolve this issue?

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by Patrick ottavi almost 9 years ago

have you tried to watch the chrome or firefox console to see if there are no readings errors on files resources or css file?

this may be a path problem that is visible with IIS

Is that the path of "AppRoot" is defined?

personally I placed the myisapiapplicatiob.dll.ini file to my website root directory.

myisapiapplication.dll.ini:

[isapi]
approot=C:\inetpub\wwwroot\Mysite\approot

Patrick.

RE: Help Please!! Trying to Configure Hello Example to Work with IIS - Added by T D almost 9 years ago

Patrick - Thanks for the suggestions. By using the Chrome Developer Tools and comparing a "working" page to a non-working page I saw the only issue between the two is that the "resources" were not being loaded on the non-working page. I was getting "Failed to load resource" errors. After some trial and error I found that simply configuring my wt_config.xml file to point to the resources path relatively instead of "C:/inetpub/wt/resources" solved the issue. Example of fix:

/resources

Thanks so much for the help!

    (1-14/14)