[Moin-user] setup problem

Chris Haynes chaynes at indiana.edu
Sat Mar 5 08:58:00 EST 2005


I'm trying to install moinmoin on an apache server, where I can't be root
on my apache server, but it runs simple scripts in /var/www/cgi-bin
ok. Following, separated by ------------, are
- the tail of the error log
- the head of the output from running /var/www/cgi-bin/moin.py from a shell,
and 
- moin.py (same as moin.cgi except for the '## cth' lines. As you see, I've
printed 
Note that I've modified moin.py to print my userid and load path, both of
which contain my local site-packages directory, containing MoinMoin.

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? The euid is the same as the uid when the server
runs the script, and the MoinMoin directory is world readable and its path
directories are all world executable.

Help is much appreciated.
-- Chris

------------------------
$ !ta
tail /var/log/httpd/error_log
ImportError: No module named MoinMoin.request
[Sat Mar  5 08:41:30 2005] [error] [client 156.56.72.206] Premature end of
script headers: /home/virtual/site69/fst/var/www/cgi-bin/moin.py
[Sat Mar  5 08:51:13 2005] [error] [client 68.142.251.158] File does not
exist: /home/virtual/site69/fst/var/www/html/robots.txt
[Sat Mar  5 08:51:13 2005] [error] [client 68.142.251.158] File does not
exist: /home/virtual/site69/fst/var/www/html/missing.html
585 ['/home/uubloomington/lib/python2.3/site-packages',
'/home/uubloomington/share/moin/uuwiki',
'/home/virtual/site69/fst/var/www/cgi-bin', '/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']
Traceback (most recent call last):
  File "moin.py", line 38, in ?
    from MoinMoin.request import RequestCGI
ImportError: No module named MoinMoin.request
[Sat Mar  5 08:52:22 2005] [error] [client 156.56.72.206] Premature end of
script headers: /home/virtual/site69/fst/var/www/cgi-bin/moin.py
[uubloomington at uubloomington.org ~/lib/python2.3/site-packages]
------------------------
$ /var/www/cgi-bin/moin.py
585 ['/home/uubloomington/lib/python2.3/site-packages',
'/home/uubloomington/share/moin/uuwiki', '/var/www/cgi-bin',
'/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']
Content-type: text/html;charset=utf-8

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="robots" content="index,follow">


<title>FrontPage - UUCB Wiki</title>
------------
$ cat /var/www/cgi-bin/moin.py
#!/usr/bin/env 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

# 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.getuid(), 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 ~/lib/python2.3/site-packages]
$ 






More information about the Moin-user mailing list