This page is a summary of how I got the stand-alone Twisted MoinMoin server working on my win98 machine. The instructions on the HelpOnInstalling/TwistedWeb page were based on a Linux install.

I use python 2.3, and I installed the latest Twisted binaries to match (there are Twisted versions for python 2.2 or python 2.3). I installed MoinMoin as described in the instructions for the Apache Windows install, running the setup.py program to copy the files to the proper directories. Once I did that, I created a directory "c:\Moin\stevewiki\". You will want to use another name that makes sense for you (that is, not stevewiki). Per the instructions for the Apache install, I copied all the files from "c:\Python23\share\moin\cgi-bin\" into the "\stevewiki\" directory, and copied the "c:\Python23\share\moin\data\" directory under "\stevewiki\".

Now all the data is in the proper place. Wiki programs are in "c:\Moin\stevewiki\", my wiki page data is in "c:\Moin\stevewiki\data\", and the base wiki images and stylesheets are in "c:\Python23\share\moin\htdocs" (put there by setup.py).

Now some files have to be changed for site-specific configuration. In moin_config.py I changed the "sitename" value to "Steve's Wiki" and the "data_dir" value to "c:/Moin/stevewiki/data/". Note the forward slashes; it probably will work either way. In moin_twisted.py I changed the "httpd_docs" value to "c:/Python23/share/moin/htdocs/" and added "sys.path.append('c:/Moin/stevewiki/')". I also had to comment out the lines:

import pwd, grp
...
uid = pwd.getpwnam(httpd_user)[2]
gid = grp.getgrnam(httpd_group)[2]

and change the line that binds application to:

application = app.Application("web")

It appears that the pwd and grp modules aren't supported under win98.

Finally, to run the Twisted server under windows you need to run the shell command:

python c:\Python23\Lib\site-packages\twisted\scripts\twistw.py --python=c:/Moin/stevewiki/moin_twisted.py -n

Only one problem - the twistw.py file that came in the package I downloaded didn't do anything. It lacked the lines:

if __name__ == "__main__":
     run()

Once that was added, it all just worked. I made a desktop shortcut to run the shell command and started wiki-ing away.

Good luck!

Addendum

I believe that using the following shell command to run Twisted under Windows instead of the one referenced above will eliminate the need for adding the if __name__ == "__main__": line.

python c:\Python23\scripts\twistd.py --python=c:/Moin/stevewiki/moin_twisted.py -n

-- MartinGignac 2004-12-04 17:25:38

Problems

Q: I install MoinMoin on Windows XP with Python-2.3 and Twisted-1.2.0-py2.3. I have followed the steps above-mentioned, but after I run the start-twisted-server-script, I got the error message:

...
exceptions.ImportError: No module named MoinMoin.request
Failed to load application: No module named MoinMoin.request

Is there something I missing? -- YentingChen

A: I know what's wrong? I should use

C:\Python23\python setup.py install --record=install.log

to install MoinMoin, rather than

C:\Python23\python setup.py install --prefix=C:\Moin --record=install.log

After I run the script second time, I get:

...
exceptions.ImportError: No module named win32con
Failed to load application: No module named win32con

So, I install the Win32 Externsion for Python, then everything works fine. :) -- YentingChen

MoinMoin: TwistedOnWindows (last edited 2007-10-29 19:20:15 by localhost)