[Moin-user] setup problem
Chris Haynes
chaynes at indiana.edu
Mon Mar 7 06:11:57 EST 2005
> From: moin-user-admin at lists.sourceforge.net
> [mailto:moin-user-admin at lists.sourceforge.net] On Behalf Of
> Thomas Waldmann
> Sent: Monday, March 07, 2005 6:47 AM
> To: moin-user at lists.sourceforge.net
> Subject: Re: [Moin-user] setup problem
>
> > How can the script import MoinMoin.request when invoked
> from the shell, but
> > not by the server, when in both cases the userid is the
> same, so protection
> > shouldn't be the issue?
>
> Maybe the command search PATH for webserver is different from yours.
>
> Maybe there is a different (much older) MoinMoin module
> somewhere else
> in PYTHONPATH.
>
> > #!/usr/bin/env python
>
> Better hardcode the path in case of problems, so you know
> what you get.
Good suggestions, but they don't help. The moin.py that follows gives the
same results: it works when invoked from a shell, but can't find
MoinMoin.request when run by the server.
I've hard coded the #! line and the entire sys.path.
Any other suggestions for things to try?
Thanks in advance,
Chris
------------------------
$ cat moin.py
#!/usr/local/bin/python
# -*- coding: iso-8859-1 -*-
"""
MoinMoin - CGI Driver Script
@copyright: 2000-2005 by Jürgen Hermann <jh at web.de>
@license: GNU GPL, see COPYING for details.
"""
# System path configuration
import sys
sys.path = ['', '/usr/local/lib/python23.zip', '/usr/local/lib/python2.3',
'/usr/local/lib/python2.3/plat-linux2', '/usr/local/lib/python2.3/lib-tk',
'/usr/local/lib/python2.3/lib-dynload',
'/usr/local/lib/python2.3/site-packages']
# Path of the directory where wikiconfig.py is located. # YOU NEED TO CHANGE
THIS TO MATCH YOUR SETUP.
sys.path.insert(0, '/home/uubloomington/share/moin/uuwiki') ## cth
# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use setup.py.
sys.path.insert(0, '/home/uubloomington/lib/python2.3/site-packages') ## cth
# Path of the directory where farmconfig.py is located (if different).
## sys.path.insert(0, '/path/to/farmconfig')
##import os ## cth
##print >>sys.stderr, os.geteuid(), sys.path ##cth
# This is used to profile MoinMoin (default disabled)
hotshotProfiler = 0
# ---------------------------------------------------------------------
if hotshotProfiler:
import hotshot
prof = hotshot.Profile("moin.prof")
prof.start()
from MoinMoin.request import RequestCGI
request = RequestCGI()
request.run()
if hotshotProfiler:
prof.close()
[uubloomington at uubloomington.org /var/www/cgi-bin]
$
More information about the Moin-user
mailing list