Differences between revisions 5 and 6
Revision 5 as of 2010-03-11 15:27:40
Size: 3857
Editor: hpersson
Comment:
Revision 6 as of 2010-03-11 15:28:23
Size: 3831
Editor: hpersson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 36: Line 36:
from MoinMoin import log

Using MoinMoin on your personal webpage

For installing MoinMoin on your personal homepage we created a small helper script called moinmoin-create. Simply run it and configure the installation interactively.

Updating Moin to 1.9.2

For every upgrade, some small changes have to be done. From 1.8.x to 1.9.2 there are some new lines and syntax changes in moinmoin/wikiconfig.py. Make it look like this:

import os
from
.config import multiconfig, url_prefix_static # NEW SYNTAX
class Config(multiconfig.!DefaultConfig):]  # NEW SYNTAX
   wikiconfig_dir = os.path.abspath(os.path.dirname(file))  # NEW
   instance_dir = wikiconfig_dir# NEW Where your own wiki pages are (make regular backups of this directory):
   data_dir = os.path.join(instance_dir, 'data', ) # NEW path with trailing /]
   data_underlay_dir = os.path.join(instance_dir, 'underlay', ) # NEW path with trailing /

The moin.fcgi file also has to be replaced with the following content:

import sys, os

# 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, '/usr/pack/moinmoin-1.9.2-hp/lib/python')

# 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/wikiuser/moinmoin')

# 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.
#log.load_config('/path/to/logging_configuration_file')
#logging = log.getLogger(__name__)
from MoinMoin import log
log.load_config('/home/wikiuser/moinmoin/logging.conf')

# 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
from MoinMoin.web.serving import make_application
app = make_application(shared=True)  # <-- adapt here as needed

# Is fixing the script name needed?
# Use None if your url looks like http://domain/wiki/moin.fcgi
# Use '' if you use rewriting to run at http://domain/
# Use '/mywiki' if you use rewriting to run at http://domain/mywiki/
fix_script_name = None  # <-- adapt here as needed

if fix_script_name is None:
    application = app
else:
    def script_name_fixer(env, start):
        env['SCRIPT_NAME'] = fix_script_name
        return app(env, start)
    application = script_name_fixer


# CGI with Apache2 on Windows (maybe other combinations also) has trouble with
# URLs of non-ASCII pagenames. Use True to enable middleware that tries to fix.
fix_apache_win32 = False  # <-- adapt here as needed

if fix_apache_win32:
    from werkzeug.contrib.fixers import PathInfoFromRequestUriFix
    application = PathInfoFromRequestUriFix(application)


## Choose your server mode (threaded, forking or single-thread)
try:
    # v-- adapt here as needed
    from flup.server.fcgi import WSGIServer
#    from flup.server.fcgi_fork import WSGIServer
#    from flup.server.fcgi_single import WSGIServer
except ImportError:
    logging.warning("No flup-package installed, only basic CGI support is available.")
    from MoinMoin.web._fallback_cgi import WSGIServer

WSGIServer(application).run()

Finally we have to delete the cache files:

rm -rf
/data/pages/*/cache/*
rm -rf
/data/cache

Restart (kill) the moin.fcgi process and

Congratulations! You just upgraded to moinmoin-1.9.2

Web/Homepage/MoinMoin (last edited 2020-09-01 09:51:09 by pmeier)