changeset 2972:70f2d676920b

add mod_wsgi driver script, rename flup/wsgi based driver script (port from 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 05 Jan 2008 21:19:50 +0100
parents 7fb3bc39c7b1
children d9bb94b15702
files wiki/server/moin.wsgi wiki/server/moin_flup_wsgi.py wiki/server/moinwsgi.py
diffstat 3 files changed, 63 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/server/moin.wsgi	Sat Jan 05 21:19:50 2008 +0100
@@ -0,0 +1,39 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - mod_wsgi driver script
+
+    To use this, add those statements to your Apache's VirtualHost definition:
+    
+    # this is for icons, css, js (and must match url_prefix from wiki config):
+    Alias       /moin_static160/ /usr/share/moin/htdocs/
+
+    # this is the URL http://servername/moin/ you will use later to invoke moin:
+    WSGIScriptAlias /moin/ /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 does not work for mod_wsgi 1.0rc1, but will work later
+
+    # use the daemons we defined above to process requests!
+    WSGIProcessGroup daemonname
+
+    @copyright: 2007 by MoinMoin:ThomasWaldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+
+# System path configuration
+import sys
+
+# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
+# or if you did not use setup.py.
+## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')
+
+# Path of the directory where farmconfig.py is located (if different).
+## sys.path.insert(0, '/path/to/farmconfig')
+
+# Path of the directory where wikiconfig.py is located.
+# YOU NEED TO CHANGE THIS TO MATCH YOUR SETUP.
+sys.path.insert(0, '/path/to/wikiconfig')
+
+from MoinMoin.server.server_wsgi import moinmoinApp as application
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiki/server/moin_flup_wsgi.py	Sat Jan 05 21:19:50 2008 +0100
@@ -0,0 +1,24 @@
+"""
+    MoinMoin - WSGI application
+
+    @copyright: 2005 by Anakim Border <akborder@gmail.com>
+    @license: GNU GPL, see COPYING for details.
+"""
+
+use_threads = True
+unixSocketPath = '/tmp/moin.sock'
+
+# Set threads flag, so other code can use proper locking
+from MoinMoin import config
+config.use_threads = use_threads
+del config
+
+from flup.server.fcgi import WSGIServer
+from MoinMoin.server.server_wsgi import moinmoinApp
+import os
+
+if __name__ == '__main__':
+    server = WSGIServer(moinmoinApp, bindAddress=unixSocketPath)
+    server.run()
+    os.unlink(unixSocketPath)
+
--- a/wiki/server/moinwsgi.py	Sat Jan 05 20:58:40 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-"""
-    MoinMoin - WSGI application
-
-    @copyright: 2005 by Anakim Border <akborder@gmail.com>
-    @license: GNU GPL, see COPYING for details.
-"""
-
-use_threads = True
-unixSocketPath = '/tmp/moin.sock'
-
-# Set threads flag, so other code can use proper locking
-from MoinMoin import config
-config.use_threads = use_threads
-del config
-
-from flup.server.fcgi import WSGIServer
-from MoinMoin.server.server_wsgi import moinmoinApp
-import os
-
-if __name__ == '__main__':
-    server = WSGIServer(moinmoinApp, bindAddress=unixSocketPath)
-    server.run()
-    os.unlink(unixSocketPath)
-