Need help getting MoinMoin to run under WSGI

R

Ron Garret

I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site. But when I tried to switch over to running it
under wsgi it failed thusly:

[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] File
"/www/wikis/genesisgroup/moin.wsgi", line 49, in ?
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] from
MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] ImportError: No
module named MoinMoin.server.server_wsgi

The problem, I believe, is that I have both Python 2.4 and 2.5 installed
(it's a Debian box) and MM is installed under 2.5 but WSGI is using 2.4.
I tried to fix this by setting WSGIPythonHome but to no avail. I can't
figure out what to set it to. The instructions say:

"the WSGIPythonHome directive should be used to specify the exact
location of the Python installation corresponding to the version of
Python compiled against"

I have two problems with this. First, I didn't compile mod_wsgi, I got
it pre-built as a Debian module. Second, what does "the exact location
of the Python installation" even mean? Python2.5 is spread out in at
least three different places: /usr/local/bin, /usr/lib/python2.5, and
/usr/local/lib/python2.5. I've tried setting WSGIPythonHome to all of
those (and a few other things as well) and nothing worked.

Also, "the version of Python compiled against" seems very odd. What
does that mean? Surely I don't have to recompile mod_wsgi every time I
change to a new version of Python?

Help! Thanks!

rg
 
R

Ron Garret

Ron Garret said:
I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site. But when I tried to switch over to running it
under wsgi it failed thusly:

[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] File
"/www/wikis/genesisgroup/moin.wsgi", line 49, in ?
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] from
MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] ImportError: No
module named MoinMoin.server.server_wsgi

The problem, I believe, is that I have both Python 2.4 and 2.5 installed
(it's a Debian box) and MM is installed under 2.5 but WSGI is using 2.4.
I tried to fix this by setting WSGIPythonHome but to no avail. I can't
figure out what to set it to. The instructions say:

"the WSGIPythonHome directive should be used to specify the exact
location of the Python installation corresponding to the version of
Python compiled against"

I have two problems with this. First, I didn't compile mod_wsgi, I got
it pre-built as a Debian module. Second, what does "the exact location
of the Python installation" even mean? Python2.5 is spread out in at
least three different places: /usr/local/bin, /usr/lib/python2.5, and
/usr/local/lib/python2.5. I've tried setting WSGIPythonHome to all of
those (and a few other things as well) and nothing worked.

Also, "the version of Python compiled against" seems very odd. What
does that mean? Surely I don't have to recompile mod_wsgi every time I
change to a new version of Python?

Help! Thanks!

rg

So never mind, I figured it out. I did indeed have to recompile
mod_wsgi from source to get it to use Python 2.5. (That turned out to
be a major hassle. I had to do it twice. The first time through it
made Apache dump core. I still don't know why.)

Seems to be working now though.

rg
 
G

Graham Dumpleton

I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site.  But when I tried to switch over to running it
under wsgi it failed thusly:
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]   File
"/www/wikis/genesisgroup/moin.wsgi", line 49, in ?
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]     from
MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] ImportError: No
module named MoinMoin.server.server_wsgi
The problem, I believe, is that I have both Python 2.4 and 2.5 installed
(it's a Debian box) and MM is installed under 2.5 but WSGI is using 2.4..  
I tried to fix this by setting WSGIPythonHome but to no avail.  I can't
figure out what to set it to.  The instructions say:
"the WSGIPythonHome directive should be used to specify the exact
location of the Python installation corresponding to the version of
Python compiled against"
I have two problems with this.  First, I didn't compilemod_wsgi, I got
it pre-built as a Debian module.  Second, what does "the exact location
of the Python installation" even mean?  Python2.5 is spread out in at
least three different places: /usr/local/bin, /usr/lib/python2.5, and
/usr/local/lib/python2.5.  I've tried setting WSGIPythonHome to all of
those (and a few other things as well) and nothing worked.
Also, "the version of Python compiled against" seems very odd.  What
does that mean?  Surely I don't have to recompilemod_wsgievery time I
change to a new version of Python?
Help!  Thanks!

So never mind, I figured it out.  I did indeed have to recompilemod_wsgifrom source to get it to use Python 2.5.  (That turned out to
be a major hassle.  I had to do it twice.  The first time through it
made Apache dump core.  I still don't know why.)

Seems to be working now though.

It probably crashed the first time because you didn't do a full stop
of Apache and instead just did a reload. Doing a reload may not unload
the Python libraries from Apache process correctly and so would have
been a mix of code for different versions of Python in same process.

Graham
 
R

Ron Garret

Graham Dumpleton said:
I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site.  But when I tried to switch over to running it
under wsgi it failed thusly:
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]   File
"/www/wikis/genesisgroup/moin.wsgi", line 49, in ?
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]     from
MoinMoin.server.server_wsgi import WsgiConfig, moinmoinApp
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] ImportError: No
module named MoinMoin.server.server_wsgi
The problem, I believe, is that I have both Python 2.4 and 2.5 installed
(it's a Debian box) and MM is installed under 2.5 but WSGI is using 2.4.
 
I tried to fix this by setting WSGIPythonHome but to no avail.  I can't
figure out what to set it to.  The instructions say:
"the WSGIPythonHome directive should be used to specify the exact
location of the Python installation corresponding to the version of
Python compiled against"
I have two problems with this.  First, I didn't compilemod_wsgi, I got
it pre-built as a Debian module.  Second, what does "the exact location
of the Python installation" even mean?  Python2.5 is spread out in at
least three different places: /usr/local/bin, /usr/lib/python2.5, and
/usr/local/lib/python2.5.  I've tried setting WSGIPythonHome to all of
those (and a few other things as well) and nothing worked.
Also, "the version of Python compiled against" seems very odd.  What
does that mean?  Surely I don't have to recompilemod_wsgievery time I
change to a new version of Python?
Help!  Thanks!

So never mind, I figured it out.  I did indeed have to
recompilemod_wsgifrom source to get it to use Python 2.5.  (That turned out
to
be a major hassle.  I had to do it twice.  The first time through it
made Apache dump core.  I still don't know why.)

Seems to be working now though.

It probably crashed the first time because you didn't do a full stop
of Apache and instead just did a reload. Doing a reload may not unload
the Python libraries from Apache process correctly and so would have
been a mix of code for different versions of Python in same process.

Graham

Yes, I don't specifically recall exactly what happened now, but that
seems likely.

Thanks,
rg
 
R

Ron Garret

So I have a MoinMoin installation running as a cgi and also under wsgi.
Since I was on a roll I decided to press my luck and try running it
under scgi. Following a suggestion in the following article:

http://www.linuxjournal.com/article/9310

I wrote this little server adapter:



from MoinMoin.server.server_cgi import CgiConfig, run

class Config(CgiConfig):
name = 'moin'

import scgi
import scgi.scgi_server

class MoinHandler(scgi.scgi_server.SCGIHandler):
def produce_cgilike(self, env, bodysize):
run(Config)

server = scgi.scgi_server.SCGIServer(
handler_class=MoinHandler,
port=4000
)

server.serve()



It works -- sort of. I can fire it up and get to the login page, but it
won't actually let me log in. I'm guessing this is because I haven't
munged the CGI form data properly. I thought I'd ask if anyone with
experience using SCGI can just tell me what I'm doing wrong before I
dive into debugging this.

Thanks,
rg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top