view wiki/server/ @ 3071:806cf4814612

get server/request package in sync with 1.6 branch (as of changeset 2559:eedcb9cfefdb)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 22 Feb 2008 21:59:32 +0100
parents ea78a739b5ad
children 80e1a910a2f1
line wrap: on
line source

# -*- coding: iso-8859-1 -*-
    MoinMoin - mod_python wrapper for broken mod_python versions

    add a .htaccess to the path below which you want to have your
    wiki instance:

    <Files wiki>
      SetHandler python-program
      PythonPath "['/path/to/moin/share/moin/cgi-bin'] + sys.path"
      PythonHandler moinmodpy

    Note: this is a wrapper needed because of a bug in
          mod_python < 3.1.3

    mod_python.apache.resolve_object fails to parse a object with dots.

    If you have a newer version, take a look at moinmodpy.htaccess
    to see how to use MoinMoin without this wrapper. You can also
    look into INSTALL.html to see how you can fix the bug on your own
    (a simple one line change).

    TODO: this should be refactored so it uses MoinMoin.server package
          (see how server_twisted, server_wsgi and server_standalone use it)

    @copyright: 2004-2005 by Oliver Graf <>
    @license: GNU GPL, see COPYING for details.

# System path configuration

import sys

# Path of the directory where is located.
sys.path.insert(0, '/path/to/wikiconfig')

# Path to MoinMoin package, needed if you installed with --prefix=PREFIX
# or if you did not use
## sys.path.insert(0, 'PREFIX/lib/python2.3/site-packages')

# Path of the directory where farmconfig is located (if different).
## sys.path.insert(0, '/path/to/farmconfig')

# Debug mode - show detailed error reports
## import os
## os.environ['MOIN_DEBUG'] = '1'

# Simple way
#from MoinMoin.server.server_modpython import modpythonHandler as handler

# Complex way
from MoinMoin.server.server_modpython import ModpythonConfig, modpythonHandler

class MyConfig(ModpythonConfig):
    """ Set up local server-specific stuff here """

    # Make sure moin will have permission to write to this file!
    # Otherwise it will cause a server error.
    logPath = "/var/log/apache2/moinlog"
    # Properties
    # Allow overriding any request property by the value defined in
    # this dict e.g properties = {'script_name': '/mywiki'}.
    ## properties = {}

def handler(request):
    return modpythonHandler(request, MyConfig)