[Moin-devel] Re: 1.3.2 does not run on IIS due to error in request.py

Robert Seeger robert.seeger at orsoft.de
Wed Jan 26 03:46:02 EST 2005


> Message: 5
> To: moin-devel at lists.sourceforge.net
> From: Alexander Schremmer <2004b at usenet.alexanderweb.de>
> Date: Wed, 26 Jan 2005 00:51:15 +0100
> Organization: XOR AX,AX
> Subject: [Moin-devel] Re: 1.3.2 does not run on IIS due to
> error in request.py
>
> On Tue, 25 Jan 2005 12:40:01 +0100, Robert Seeger wrote:
>
> > Sorry, I forgot to mention that I had fixed the request_uri
> issue as well.
> > IIS does indeed not supply 'REQUEST_URI', so my workaround
> for an issue with
> > this (I think I fixed this in 1.3.0 already and did not
> think about it) was
> >         self.request_uri = env.get('REQUEST_URI',
> '%s'%self.script_name)
> > (this is probably not quite correct, I just needed
> something useful in that
> > variable for the request.url variable that is used to find
> a wiki in a farm
> > config).
> > Thus, the first check was always true in my case and the problem was
> > self-made. Nevertheless I think that
> >   server_software.find('Apache/1.3') == -1
> > was meant to be
> >   server_software.find('Apache/1.3') != -1
> > if the first check was intended for apache only.
>
> No, it was not. The first check should just run if a) there is an
> request_uri (a valid one) and b) the server is not Apache 1.3.
> I guess you screwed up request_uri (your code does not seem
> to assemble it
> correctly) and glitched into this problem. I am not sure if I
> should have
> expected such a broken request_uri :-)
>
> Maybe you give us some reasons why MoinMoin needs that request_uri ...
> Normally, it should not. Please try to run MoinMoin 1.3.3
> with no local
> modifications (at least not in that function :-)) and the
> following patch
> applied: (see first link on that page)
> 	http://moinmoin.wikiwikiweb.de/KnownIssues
>
> Kind regards,
> Alexander

Sorry, I messed it all up with wrong assumptions about Alexander's
intentions. Next time I'd better ask first and only then try to fix it by
myself ;-).
So, I revoked my changes in request.py and applied the patch from
http://moinmoin.wikiwikiweb.de/MoinMoinBugs/request%2epy_broken_on_IIS
(as this was the only relevant line changed from 1.3.2 to 1.3.3, I ignored
the other 1.3.3 modules for now).
As a result, however, I get a configuration error:

 MoinMoin Configuration Error
 Could not find a match for url: "ors-x-know".

 Check your URL regular expressions in the "wikis" list in "farmconfig.py".

The reason for this is that the checked url (in multiconfig.getConfig(url))
only contains the server name, but not the part that identifies a wiki
instance.
This again is due to request.py, line 253:
        self.url = self.server_name + self.request_uri

which does not work if there is no significant self.request_uri

Here is some details about my installation:

I'm running a farm on a single server {{{ors-x-know}}} with a number of wiki
instances. The following table lists their url in IIS, the regex and
wikiname used in farmconfig.py

 ||URL                                        ||wikiname||regex||

||{{{http://ors-x-know/master11cgi/moin.cgi}}}||master11||{{{r".*master11.*$
"}}}||

||{{{http://ors-x-know/master13cgi/moin.cgi}}}||master13||{{{r".*master13.*$
"}}}||

||{{{http://ors-x-know/devinfocgi/moin.cgi}}}||master13||{{{r".*devinfo.*$"}
}}||

With the above setting, the checked url is only {{{ors-x-know}}}

This is why I did the mentioned hack:
	self.request_uri = env.get('REQUEST_URI', '%s'%self.script_name)
and glitched into the wrong check.

I have now modified this hack:
 * In the IIS specific patch starting on line 233, add:
            self.request_uri = '%s'%self.script_name

This makes the checked url e.g. {{{ors-x-know/master13cgi/moin.cgi}}} which
makes my setting happy, though it might not be the correct value for
request_uri (should probably include the full path and parameters?)

Maybe the proper solution would be to set self.url differently in the
RequestCGI class (some other derived classes do this)?

Kind Regards,
Robert









More information about the Moin-devel mailing list