WebFaction
Community site: login faq

Hello,

I'm trying to install moinmoin 1.9.3 with this forum tutorial created by charliecompany ( http://forum.webfaction.com/viewtopic.php?id=4369 )

test.wsgi is ok, but index.wsgi produce a 500 internal server error ... Thanks a lot if you have some information about my problem :)

My httpd.conf :

    ServerRoot "/home/reyman64/webapps/moinwikigame/apache2"

LoadModule dir_module        modules/mod_dir.so
LoadModule env_module        modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module       modules/mod_mime.so
LoadModule rewrite_module    modules/mod_rewrite.so
LoadModule setenvif_module   modules/mod_setenvif.so
LoadModule wsgi_module       modules/mod_wsgi.so
LoadModule alias_module       modules/mod_alias.so

LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /home/reyman64/logs/user/access_moinwikigame.log combined
#DirectoryIndex index.py
DocumentRoot /home/reyman64/webapps/moinwikigame/htdocs
ErrorLog /home/reyman64/logs/user/error_moinwikigame.log
KeepAlive Off
Listen 24931
MaxSpareThreads 3
MinSpareThreads 1
ServerLimit 1
SetEnvIf X-Forwarded-SSL on HTTPS=1
ThreadsPerChild 5
WSGIDaemonProcess moinwikigame processes=5 python-path=/home/reyman64/webapps/moinwikigame/lib/python2.6 threads=1

Alias /favicon.ico /home/reyman64/webapps/moinwikigame/htdocs/favicon.ico
WSGIScriptAlias / /home/reyman64/webapps/moinwikigame/htdocs/index.wsgi

<Directory /home/reyman64/webapps/moinwikigame/htdocs>
    AddHandler wsgi-script .py
</Directory>

index.wsgi

# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - mod_wsgi driver script

    To use this, add those statements to your Apache's VirtualHost definition:

    # you will invoke your moin wiki at the root url, like http://servername/FrontPage:
    WSGIScriptAlias / /some/path/moin.wsgi

    # create some wsgi daemons - use someuser.somegroup same as your data_dir:
    WSGIDaemonProcess daemonname user=someuser group=somegroup processes=5 threads=10 maximum-requests=1000 umask=0007

    # use the daemons we defined above to process requests!
    WSGIProcessGroup daemonname

    @copyright: 2008 by MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.
"""

import sys, os

#
 a) Configuration of Python's code search path
#    If you already have set up the PYTHONPATH environment variable for the
#    stuff you see below, you don't need to do a1) and a2).

# a1) Path of the directory where the MoinMoin code package is located.
#     Needed if you installed with --prefix=PREFIX or you didn't use setup.py.
#sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')

# a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
#     See wiki/config/... for some sample config files.
sys.path.insert(0, '/home/reyman64/webapps/moinwikigame/htdocs/')
#sys.path.insert(0, '/path/to/farmconfigdir')

# b) Configuration of moin's logging
#    If you have set up MOINLOGGINGCONF environment variable, you don't need this!
#    You also don't need this if you are happy with the builtin defaults.
#    See wiki/config/logging/... for some sample config files.
#from MoinMoin import log
#log.load_config('/path/to/logging_configuration_file')

from MoinMoin.web.serving import make_application

# Creating the WSGI application
# use shared=True to have moin serve the builtin static docs
# use shared=False to not have moin serve static docs
# use shared='/my/path/to/htdocs' to serve static docs from that path
application = make_application(shared=True)

Error msg :

on Mar 21 04:27:20 2011] [notice] Apache/2.2.17 (Unix) mod_wsgi/3.3 Python/2.6.5 configured -- resuming normal operations
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1] mod_wsgi (pid=22107): Target WSGI script '/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi' cannot be loaded as Python module.
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1] mod_wsgi (pid=22107): Exception occurred processing WSGI script '/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi'.
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1]   File "/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi", line 43, in <module>
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1]     from MoinMoin.web.serving import make_application
[Mon Mar 21 04:27:22 2011] [error] [client 127.0.0.1] ImportError: No module named MoinMoin.web.serving

[reyman64@web176 python2.6]$ ll
total 496
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 action
drwxr-xr-x  4 reyman64 reyman64  4096 Mar 13 17:25 auth
-rw-r--r--  1 reyman64 reyman64 10577 Mar 13 17:25 caching.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 config
-rw-r--r--  1 reyman64 reyman64  3930 Mar 13 17:25 conftest.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 converter
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 datastruct
-rw-r--r--  1 reyman64 reyman64  3507 Mar 13 17:25 error.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 events
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 filter
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 formatter
drwxr-xr-x  4 reyman64 reyman64  4096 Mar 13 17:25 i18n
-rw-r--r--  1 reyman64 reyman64   220 Mar 13 17:25 __init__.py
drwxr-xr-x  2 reyman64 reyman64  4096 Mar 13 17:25 logfile
-rw-r--r--  1 reyman64 reyman64  5614 Mar 13 17:25 log.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 macro
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 mail
-rw-r--r--  1 reyman64 reyman64  1031 Mar 13 17:25 multiconfig.py
-rw-r--r--  1 reyman64 reyman64 22363 Mar 13 17:25 packages.py
-rw-r--r--  1 reyman64 reyman64 52884 Mar 13 17:25 PageEditor.py
-rw-r--r--  1 reyman64 reyman64 17937 Mar 13 17:25 PageGraphicalEditor.py
-rw-r--r--  1 reyman64 reyman64 75143 Mar 13 17:25 Page.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 parser
drwxr-xr-x 12 reyman64 reyman64  4096 Mar 13 17:25 script
drwxr-xr-x  5 reyman64 reyman64  4096 Mar 13 17:25 search
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 security
drwxr-xr-x  2 reyman64 reyman64  4096 Mar 13 17:25 stats
drwxr-xr-x  7 reyman64 reyman64  4096 Mar 13 17:25 support
-rw-r--r--  1 reyman64 reyman64   215 Mar 13 17:25 _template.py
drwxr-xr-x  2 reyman64 reyman64  4096 Mar 13 17:25 _tests
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 theme
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 userform
drwxr-xr-x  2 reyman64 reyman64  4096 Mar 13 17:25 userprefs
-rw-r--r--  1 reyman64 reyman64 34570 Mar 13 17:25 user.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 util
-rwxr-xr-x  1 reyman64 reyman64  1078 Mar 13 17:25 version.py
drwxr-xr-x  4 reyman64 reyman64  4096 Mar 13 17:25 web
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 widget
-rw-r--r--  1 reyman64 reyman64 18688 Mar 13 17:25 wikisync.py
-rw-r--r--  1 reyman64 reyman64 93831 Mar 13 17:25 wikiutil.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 wikixml
-rw-r--r--  1 reyman64 reyman64 10609 Mar 13 17:25 wsgiapp.py
drwxr-xr-x  3 reyman64 reyman64  4096 Mar 13 17:25 xmlrpc

asked 21 Mar '11, 04:12

reyman64
13615
accept rate: 25%

edited 21 Mar '11, 04:44


From looking at your error log (~/logs/user/error_moinwikigame.log), the problem appears to be an IndentationError:

mod_wsgi (pid=10838, process='', application='web176.webfaction.com|'): Failed to parse WSGI script file '/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi'.
mod_wsgi (pid=10838): Exception occurred processing WSGI script '/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi'.
  File "/home/reyman64/webapps/moinwikigame/htdocs/index.wsgi", line 23
     a) Configuration of Python's code search path
    ^
 IndentationError: unexpected indent
permanent link

answered 21 Mar '11, 04:19

David L ♦♦
1.4k13
accept rate: 45%

Tks! Corrected! But i have 500 error with this message, see update on post :/

(21 Mar '11, 04:30) reyman64

It looks like you haven't installed MoinMoin yet - there is no MoinMoin module in your ~/lib/python2.6 directory.

Are you sure it's installed correctly?

(21 Mar '11, 04:37) David L ♦♦

Yes, i have all moinmoin .py in python2.6 lib folder .. see updated post

(21 Mar '11, 04:43) reyman64

That's not correct. You've installed the contents of the MoinMoin directory when you should have installed the directory itself.

Just remove those files and re-install MoinMoin and you should be good to go :)

(21 Mar '11, 04:48) David L ♦♦

ok, a little cp -r /MoinMoin folder in ~/lib/python2.6 :] it's great, wiki run : Tks a lot David ! What a silly error ...

(21 Mar '11, 05:03) reyman64
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×108
×62
×19
×6
×4

question asked: 21 Mar '11, 04:12

question was seen: 9,509 times

last updated: 21 Mar '11, 05:04

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM