0-byte 200/404 response with HelloWorld?

Sep 18, 2009 at 9:04 PM
Edited Sep 18, 2009 at 9:09 PM

Hi!

Seems I'm not very good at this Windows stuff, I'm having the weirdest problem.

The platform is Windows 2003 Server, meaning IIS6, and IronPython 2.6 (because I'm hoping this will all lead up to Django, and that seems to want 2.6 :)

I installed NWSGI-1.0-x86.msi, with the Hello World example.

Created C:\Inetpub\wwwroot\Hello\

Copied hello.wsgi there

Created C:\Inetpub\wwwroot\Hello\bin\

Copied NWSGI.dll there

Copied IronPython.dll, IronPython.Modules.dll, Microsoft.Scripting.Core.dll and Microsoft.Scripting.dll

Copied Web.Classic.config into C:\Inetpub\wwwroot\Hello\ and renamed it to Web.config

Now it gets hairy ;)

1)

I'm assuming that when the readme says "If the server is running IIS6, it needs a script mapping for *.wsgi that forwards it to the ASP.NET ISAPI dll." you do not mean the kind of xml definitions in http://nwsgi.codeplex.com/Thread/View.aspx?ThreadId=60416 but instead something in IIS to point to C:\Inetpub\wwwroot\Hello\bin\NWSGI.dll

What made sense was Default Web Site -> Properties -> ISAPI Filters.

There I created a new filter called asdf with the above path as the executable. I also changed the home directory to the Hello one, because without it, the ASP.NET Property tab would have a broken path for web.config, and the field in the form is not editable.

After restarting IIS I just get an empty response, but Firebug on Firefox tells me it's code 200.

2)

So I removed the ISAPI Filter, went to Home Directory -> Configuration button, added executable NWSGI.dll and extension .wsgi in the Mappings tab.

Now http://localhost/ shows me a directory list! However, both hello.wsgi and Web.config give me 404(!) though the web subdir works and I can download DLLs from there.

3)

I reset the changes; I reset the Home Directory to C:\Inetpub\wwwroot and remove the NWSGI extension/executable.

The Hello directory is visible already :o And all the good stuff is prohibited :o

New Virtual Directory -> Alias Hello -> Location C:\Inetpub\wwwroot\Hello\ -> Read & Execute

So I access http://localhost/Hello/ (Listing is denied) and http://localhost/Hello/hello.wsgi (404)

Then to the Virtual Directory tab -> Configuration button -> Mappings tab where I added the .wsgi extension with the NWSGI.dll executable. Still 404 :(

(I also noticed that the URL seems case-insensitive wrt /Hello/ and /hello/, which seems a bit buggy, but whatever :)

Where did I go astray? Any ideas?

Thanks!!

 

Sep 18, 2009 at 9:13 PM

(Oops! I had JavaScript disabled and that threw all the formatting away; I got a horribly formatted email myself, but fixed it for the web - should be readable now for all :)

Sep 19, 2009 at 12:12 PM

!!

Made some progress, I figured out that the 404 is a common problem with misconfigured ISAPI, so I added C:\Inetpub\wwwroot\Hello\bin\NWSGI.dll as a Web Service Extension.

Combined with the Virtual Directory -> Configuration -> Mapping .wsgi configuration it tells me "The specified procedure could not be found" 500
(Internal Server Error)

The internet shows some occurrences, but they all seem application-specific and I'm not sure where to go with this debugging...

Any and all help is still much appreciated!

Thanks!

Sep 20, 2009 at 10:32 AM

I'll update the status here, in case someone Googles the same issue.

Turned out, on the IronPython mailing list, that the wsgi must be handled by the same isapi handler as .aspx, and nwsgi.dll must just be available. The readme also doesn't tell about all dlls that must be copied, there's also Microsoft.Scripting.ExtensionAttribute.dll, Microsoft.Dynamic.dll and Microsoft.Scripting.Debugging.dll that are required, at least for me.

Now my only problem is that the osEnviron tag doesn't work; "Parser Error Message: Unrecognized element 'osEnviron'."

I'll try to figure it out, so far nothing, like adding a <trust /> tag :/