[Moin-user] running 1.2.4 with mod_python
jcarroll at totality.com
Fri Dec 24 12:26:00 EST 2004
> The double slashes // above indicate you have an extra slash
> somewhere in your .htaccess files.
Actually, I already listed the entire contents of the .htaccess file in my
original post (without the comments); no slashes worth mentioning, aside
from the PythonPath directive.
> The Apache web site docs for .htaccess files recommends that
> you not use them if you have access to httpd.conf. If you
> have the bug-free version of mod-python that is loaded
> automatically in the current Apache version, changing from
> cgi to mod-python requires only commenting out one statement
> and adding an equivalent location
> #ScriptAlias /mywiki "/somepath/Moin/mywiki/moin.cgi"
> <Location /mywiki>
> SetHandler python-program
> PythonPath "['/somepath/Moin/mywiki/']+sys.path"
> PythonHandler MoinMoin.request::RequestModPy.run
> PythonDebug On
> Note the location directive authorizes a program -- the
> program can do whatever it wants subject to OS permissions.
Fascinating. I did as you suggested and it worked exactly as you said it
would. And yet it's puzzling that my .htaccess approach didn't work, since
all it had was the SetHandler/PythonPath/PythonHandler/PythonDebug lines.
At this point I'm not about to scrutinize it to death, since it now works.
> Directory statements and .htaccess end up doing the same, but
> tend to give a false sense that they are somehow giving
> access to one directory and protecting others.
My intent wasn't to facilitate directory-level access control, but rather a)
follow the MoinMoin docco (the only thing I did differently was to drop the
<Files>/</Files> lines and push the .htaccess file down one directory; I
couldn't get it to work as per the MoinMoin docco) and b) make it trivial to
create another wiki without resorting to editing httpd.conf and forcing an
httpd restart. Based on your very helpful recommendations, the former would
appear to need an update, and the latter a failed exercise.
Given that this is a Red Hat box, I may try to break the meaninful chunks
out of httpd.conf and put them (read: the master Moin definition and
separate files for each wiki) into /etc/httpd/conf.d/. Anyway, this is
something I can fiddle with. I'll share my results with the Dev team if
they're interested, assuming it turns out to be relatively clean.
Thanks again for your lucid explanation. :)
> Roger Haase
More information about the Moin-user