2009/1/5 Todd O'Bryan <[email protected]>:
>
> I just set up a path-based wiki farm for MoinMoin today and had
> trouble finding sample configs for mod_wsgi.
>
> I wrote up a description of what worked for me here:
>
> http://moinmo.in/ToddOBryan
>
> Hope it's helpful to someone and will show up when somebody else googles it.

You have:

<LocationMatch /wikis/[^/]+>
        WSGIProcessGroup wikis
        WSGIApplicationGroup %{GLOBAL}
</LocationMatch>

and said:

"""The regular expression in the LocationMatch directive matches the
common path of the URL along with the part that identifies which wiki
in the farm to use. This only works because all of the wikis are
contained in a single path on the server and the part of the URL that
represents the wiki (abc, d, and random_name, in my example) doesn't
contain a slash. If you're okay with those limitations, this should
work."""

You could have just used:

<Location /wikis>
        WSGIProcessGroup wikis
        WSGIApplicationGroup %{GLOBAL}
</Location>

or since I tend to recommend against using Location because of the bad
ways that mod_python has encouraged it to be used, use:

<DIrectory /path/to>
        WSGIProcessGroup wikis
        WSGIApplicationGroup %{GLOBAL}
</Directory>

Where '/path/to' is the file system directory where the moin.wsgi
script file is kept. That is, based it off actual file system location
rather than URL.

Since you by rights probably should also already have a Directory
container for the directory the script is in, ie., at least:

<DIrectory /path/to>
        Order allow,deny
        Allow from all
</Directory>

it can just go in that existing Directory container.

If you don't have such a Directory container, it potentially shows you
have put an 'Allow from all' in an in appropriate context, ie., for
all of file system from '/' or from URL location of '/', both of which
are bad from a security standpoint.

I actually also question your use of WSGIScriptAliasMatch. One could
also have said:

WSGIScriptAlias /wikis /path/to/moin.wsgi

The only issue with saying that though is that someone could say just
'/wikis' or '/wikis/' and would also be handled. If the MoinMoin
application doesn't handle that in a sensible way then may be an
issue.

Finally, the argument to WSGIProcessGroup doesn't match
WSGIDaemonProcess you created.

Thus, making path names more obvious, would have expected the following be used:

WSGIDaemonProcess wikis

WSGIScriptAlias /wikis /path/to/moin/scripts/moin.wsgi

<Directory /path/to/moin/scripts>
        Order allow,deny
        Allow from all
        WSGIProcessGroup wikis
        WSGIApplicationGroup %{GLOBAL}
</Directory>

Alias /moin_staticXXX /path/to/moin/htdocs

<Directory /path/to/moin/htdocs>
        Order allow,deny
        Allow from all
</Directory>

BTW, did you really mean '/moin_staticXXX'?

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to