Wildcard conf on IIS6

View: New views
12 Messages — Rating Filter:   Alert me  

Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

The original thread seems to have withered out, so I'll make a new one.

I'm still having the problems with getting wildcards configured on IIS6,
so this is just an attempt to ask if someone who might have skipped
the original thread might see this and have a clue on how to get it
going :)

Thanks!

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Dody Gunawinata :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There's no progress on my side yet and I am swamped at work :( It looks like Jeff's busy as well.

2009/10/9 Markus Törnqvist <mjt@...>
Hi!

The original thread seems to have withered out, so I'll make a new one.

I'm still having the problems with getting wildcards configured on IIS6,
so this is just an attempt to ask if someone who might have skipped
the original thread might see this and have a clue on how to get it
going :)

Thanks!

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
nomadlife.org


_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Jeff Hardy-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, sorry, I've been a bit crazy lately. I'll see if I can find some
time in the next few days to whip up an example for you - I know that
it works on IIS 6, because I made sure to test it when I was writing
it.

- Jeff

On Sun, Oct 11, 2009 at 8:05 AM, Dody Gunawinata
<empirebuilder@...> wrote:

> There's no progress on my side yet and I am swamped at work :( It looks like
> Jeff's busy as well.
>
> 2009/10/9 Markus Törnqvist <mjt@...>
>>
>> Hi!
>>
>> The original thread seems to have withered out, so I'll make a new one.
>>
>> I'm still having the problems with getting wildcards configured on IIS6,
>> so this is just an attempt to ask if someone who might have skipped
>> the original thread might see this and have a clue on how to get it
>> going :)
>>
>> Thanks!
>>
>> --
>> mjt
>>
>> _______________________________________________
>> Users mailing list
>> Users@...
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
>
> --
> nomadlife.org
>
>
> _______________________________________________
> Users mailing list
> Users@...
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Jeff Hardy-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Markus,
I finally got around to looking at this, and it looks like I missed a
step in my documentation (such as it is...). If you check out
http://jdhardy.blogspot.com/2009/07/nwsgi-20-removing-url-warts.html
it gives all of the details (under the heading "Wildcards"), but I'll
explain it here too.

First up, you need to configure IIS 6 to serve wildcard requests for
the application to the aspnet_isapi.dll. This is explained at
http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx.

Next, you need to modify the web.config file for the application to do
two things: first, add the <wildcard> element under <wsgi> to tell
NWSGI that it's in wildcard mode, AND (this is the part I missed)
change the handler mapping to be path="*" instead of path="*.wsgi".
I've attached a web.config for the HelloWorld app that properly
configures NWSGI for wildcard mode.

I'm hoping to get a script written that will configure IIS 6 for NWSGI
apps and skip the manual steps, but that means diving into the joy
that is IIS 6's management API...

- Jeff

2009/10/9 Markus Törnqvist <mjt@...>:

> Hi!
>
> The original thread seems to have withered out, so I'll make a new one.
>
> I'm still having the problems with getting wildcards configured on IIS6,
> so this is just an attempt to ask if someone who might have skipped
> the original thread might see this and have a clue on how to get it
> going :)
>
> Thanks!
>
> --
> mjt
>
> _______________________________________________
> Users mailing list
> Users@...
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>


_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Web.config (1K) Download Attachment

Re: Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Oct 17, 2009 at 02:20:38PM -0600, Jeff Hardy wrote:
>Hi Markus,

Hi!

>I finally got around to looking at this, and it looks like I missed a
>step in my documentation (such as it is...). If you check out
>http://jdhardy.blogspot.com/2009/07/nwsgi-20-removing-url-warts.html
>it gives all of the details (under the heading "Wildcards"), but I'll
>explain it here too.

I had found that by myself too, I based my conf on it ;)

>First up, you need to configure IIS 6 to serve wildcard requests for
>the application to the aspnet_isapi.dll. This is explained at
>http://professionalaspnet.com/archive/2007/07/27/Configure-IIS-for-Wildcard-Extensions-in-ASP.NET.aspx.

This I did, I think I got the hint off the list :)

>Next, you need to modify the web.config file for the application to do
>two things: first, add the <wildcard> element under <wsgi> to tell
>NWSGI that it's in wildcard mode, AND (this is the part I missed)
>change the handler mapping to be path="*" instead of path="*.wsgi".
>I've attached a web.config for the HelloWorld app that properly
>configures NWSGI for wildcard mode.

This is surprisingly close to what I have currently, and unfortunately
neither work! :|

I'm wondering about
    <wildcard physicalPath="~/hello.wsgi" />
What does ~ resolve to here?

Under unixes it's of course the home directory, and I had something like
C:\Program Files\IronPython 2.6\whatever\mysite\hello.wsgi

The Hello World stuff:

I figured I'd deploy the hello world application from commit 32122
which I had conveniently lying around. I did it by changing the
Default Web Service from the stuff I'm developing to point to a dir
with HelloWorld, with the bin subdir and all.

I also renamed the classic Web.config and accessed http://localhost/hello.wsgi
The URL http://localhost/ gave me a dir listing.

Then I changed the <wsgi><wildcard /></wsgi> definition and
<httpHandlers><add path="*" /></httpHandlers>

Now http://localhost/ works as well, hooray!

But where is the fail?
Here: http://localhost/test/

It still gives a 404; now I'm getting confused about what that wildcard
stuff is supposed to mean even :|

I'm attaching my Web.config so you can take a look, but I matched
the <wildcard physicalPath> and <add path> so I dunno, man, I dunno...

A very wild speculation would be what if Django misunderstood the path
requested, or something, and returned a 404, which IIS would catch
and replace with its own? But then again, totally valid paths in mysite
should work, so this would make no sense.

Did http://localhost/test/ work for you on your HelloWorld installation?

Any other totally random arbitrary paths?

If you have hello.wsgi like this:

def application(environ, start_response):
    """Simplest possible application object"""
    status = '200 OK'
    response_headers = [('Content-type','text/plain')]
    start_response(status, response_headers)
    env = '\n'.join('%s: %s' % (k, v) for k, v in environ.items())
    return ['Hello world!\n%s' % env]

Does it give any clues on the path stuff?

For me it obviously does not as only / is recognized :D

>I'm hoping to get a script written that will configure IIS 6 for NWSGI
>apps and skip the manual steps, but that means diving into the joy
>that is IIS 6's management API...

This would be truly awesome, but sounds like a ton of work.

Thanks! :)

--
mjt


<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="wsgi" type="NWSGI.WsgiSection, NWSGI, Version=1.99.3.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86" />
    </configSections>

    <wsgi frames="Full" enableExtensions="true">
        <pythonPaths>
            <path path="C:\Program Files\IronPython 2.6\Lib" />
            <path path="C:\Program Files\IronPython 2.6\Lib\site-packages" />
            <!-- PROBABLY REDUNDANT -->
            <path path="C:\Program Files\IronPython 2.6\Lib\site-packages\django" />
            <path path="C:\Program Files\IronPython 2.6\Lib\site-packages\mysite" />
        </pythonPaths>
 
  <wildcard physicalPath="~/hello.wsgi" />
 
    </wsgi>

    <location allowOverride="true">
    <system.web>
        <compilation debug="true" />
       
        <httpHandlers>
            <add verb="*" path="*" type="NWSGI.WsgiHandler, NWSGI, Version=1.99.3.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86" />
        </httpHandlers>

  <!-- Wonder what I was trying to achieve here :D -->
  <!--
       <securityPolicy>
          <trustLevel name="Full" policyFile="internal" />
          <trustLevel name="High" policyFile="web_hightrust.config" />
          <trustLevel name="Medium" policyFile="web_mediumtrust.config" />
          <trustLevel name="Low" policyFile="web_lowtrust.config" />
          <trustLevel name="Minimal" policyFile="web_minimaltrust.config"/>
       </securityPolicy>
       -->
       <!-- <trust
          level="Full"
          originUrl=""
          processRequestInApplicationTrust="true"
        />-->
  <!--
        <trust level="Full" originUrl="/" />
  -->
    </system.web>
    </location>
       
    <!-- IIS7 -->
    <system.webServer>
        <handlers>
            <add name="WsgiHandler" path="*.wsgi" verb="*" type="NWSGI.WsgiHandler, NWSGI, Version=1.99.3.0, Culture=neutral, PublicKeyToken=41e64ddc1bf1fc86" resourceType="Unspecified" />
        </handlers>
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>
</configuration>


_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Jeff Hardy-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/18 Markus Törnqvist <mjt@...>:
>>I finally got around to looking at this, and it looks like I missed a
>>step in my documentation (such as it is...). If you check out
>>http://jdhardy.blogspot.com/2009/07/nwsgi-20-removing-url-warts.html
>>it gives all of the details (under the heading "Wildcards"), but I'll
>>explain it here too.
>
> I had found that by myself too, I based my conf on it ;)

I updated it just recently, as there were some omissions.

>
> I'm wondering about
>    <wildcard physicalPath="~/hello.wsgi" />
> What does ~ resolve to here?

The root of the web application - it's an ASP.NET convention. If
http://example.com/HelloWorld/ is an ASP.NET application that is
stored C:\HelloWorld\, then http://example.com/HelloWorld/hello.wsgi
-> ~/hello.wsgi -> C:\HelloWorld\hello.wsgi. Using ~/... allows the
app's folders to be moved around the file system without breaking the
configuration.

>
> The Hello World stuff:

>
> Now http://localhost/ works as well, hooray!

So you were able to get the HelloWorld app to work using wildcards, correct?

>
> But where is the fail?

I think this is going to take some deeper digging - do you know how to
get a metabase.xml file? Can you send me a copy of yours directly
(off-list)?

- Jeff
_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Oct 18, 2009 at 06:40:57PM -0600, Jeff Hardy wrote:

>> The Hello World stuff:
>
>> Now http://localhost/ works as well, hooray!
>
>So you were able to get the HelloWorld app to work using wildcards, correct?

That would be stretching the term...

Like I said in the original post, I got it working under / but
not eg. /test/ or /foo/ which would be truly wildcard.

Did URLs like that work anywhere else?

>> But where is the fail?
>I think this is going to take some deeper digging - do you know how to
>get a metabase.xml file? Can you send me a copy of yours directly
>(off-list)?

I don't, but if you tell me, I'd be happy to oblige :)

Thanks!

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Dody Gunawinata :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 MetaBase.xml and MBSchema.xml. IIS stores these files in the systemroot\System32\Inetsrv folder of your computer

2009/10/19 Markus Törnqvist <mjt@...>
On Sun, Oct 18, 2009 at 06:40:57PM -0600, Jeff Hardy wrote:

>> The Hello World stuff:
>
>> Now http://localhost/ works as well, hooray!
>
>So you were able to get the HelloWorld app to work using wildcards, correct?

That would be stretching the term...

Like I said in the original post, I got it working under / but
not eg. /test/ or /foo/ which would be truly wildcard.

Did URLs like that work anywhere else?

>> But where is the fail?
>I think this is going to take some deeper digging - do you know how to
>get a metabase.xml file? Can you send me a copy of yours directly
>(off-list)?

I don't, but if you tell me, I'd be happy to oblige :)

Thanks!

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
nomadlife.org


_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 10:09:14AM +0200, Dody Gunawinata wrote:
> MetaBase.xml and MBSchema.xml. IIS stores these files in the
>*systemroot*\System32\Inetsrv
>folder of your computer

Cool!

Is there anything specific I should be on the lookout for?

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Jeff Hardy-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/10/19 Markus Törnqvist <mjt@...>:
> On Mon, Oct 19, 2009 at 10:09:14AM +0200, Dody Gunawinata wrote:
>> MetaBase.xml and MBSchema.xml. IIS stores these files in the
>>*systemroot*\System32\Inetsrv
>>folder of your computer
>
> Cool!
>
> Is there anything specific I should be on the lookout for?

Nope. I just want to check your configuration against mine (I have a
feeling we're missing something simple), and this is the easiest way.

- Jeff
_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 08:26:45AM -0600, Jeff Hardy wrote:
>
>Nope. I just want to check your configuration against mine (I have a
>feeling we're missing something simple), and this is the easiest way.

I emailed you the files...

I'll be afk for a couple of hours, but otherwise I could try to keep
an eye on my mail if you'd find anything :)

... Still can't understand why wildcard isn't "every imaginable path" :|

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: Wildcard conf on IIS6

by Markus Törnqvist :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Oct 18, 2009 at 06:40:57PM -0600, Jeff Hardy wrote:
>2009/10/18 Markus Törnqvist <mjt@...>:
>> Now http://localhost/ works as well, hooray!
>So you were able to get the HelloWorld app to work using wildcards, correct?

Yeah, like we discussed off-list, it started working.

My mistake was the Verify that file exists checkbox, I thought it was
about the isapi handler file, because I haven't thought of URLs as
files for years :/ But that's what it means, the wildcard would be used
only for paths that also have a physical file in some location...

I'm also catching a flu here, which kinda sets me back, but it might
be NWSGI has issues with Django and paths on another level.

I get redirected to /set_test_cookie/ as expected, but it raises an exception
in django\views\debug.py:246 or so, the exception.args[0]['tried'] part
raises a KeyError.

Hacking around, raise ValueError('|%s|' % exception.args[0]) looks like
 |{'path': 'set_test_cookie/'}|

I traced the problem to urlresolvers.py:199, resolve function, which
raises Resolver404, {'path' : path}

This is tested on Django 1.0.3 and 1.0.4 (with the appropriate patches from
http://bitbucket.org/jdhardy/django-ipy/ of course :)

Jeff, is there something "interesting" in NWSGI and path handling?

I'll probably look at this later, but I'm not feeling up to heavy thinking
right now, monkeying around with this was tough enough with the flu ;)

Thanks!

--
mjt

_______________________________________________
Users mailing list
Users@...
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com