MoinMoin
Warning:
So far, Unit doesn’t support handling the REMOTE_USER headers directly, so authentication should be implemented via other means. For a full list of available authenticators, see here.
To run the MoinMoin wiki engine using Unit:
-
Install Unit with a Python 2 language module.
Note:
As of now, MoinMoin doesn’t fully support Python 3. Mind that Python 2 is officially deprecated. -
Install and configure MoinMoin’s prerequisites
-
Install MoinMoin’s core files. Here we install them at /path/to/app; use a real path in your configuration.
For example:
tar xzf moin-X.Y.Z.tar.gz --strip-components 1 -C /path/to/app/ # MoinMoin version | Path to the application directory; use a real path in your configuration
-
Configure your wiki instances:
See the ‘Single Wiki’ section here for an explanation of these commands:
cd /path/to/app/ # Path to the application directory; use a real path in your configuration
mkdir single/
cp wiki/config/wikiconfig.py single/ # Wiki instance configuration
cp -r wiki/data/ single/data/
cp -r wiki/underlay/ single/underlay/
cp wiki/server/moin.wsgi single/moin.py # WSGI module to run, extension should be changed for proper discovery
Next, edit the wiki instance configuration in wikiconfig.py as appropriate.
See the 'Multiple Wikis' section [here](https://master.moinmo.in/InstallDocs/ServerInstall) for an explanation of these commands:
cd /path/to/app/ # Path to the application directory; use a real path in your configuration
mkdir multi/ multi/wiki1/ multi/wiki2/
cp wiki/config/wikifarm/* multi/
cp wiki/config/wikiconfig.py multi/wiki1.py # Wiki instance configuration
cp wiki/config/wikiconfig.py multi/wiki2.py # Wiki instance configuration
cp -r wiki/data/ multi/wiki1/data/
cp -r wiki/data/ multi/wiki2/data/
cp -r wiki/underlay/ multi/wiki1/underlay/
cp -r wiki/underlay/ multi/wiki2/underlay/
cp wiki/server/moin.wsgi multi/moin.py # WSGI module to run, extension should be changed for proper discovery
Next, edit the farm configuration in farmconfig.py and the wiki instance configurations, shown here as wiki1.py and wiki2.py, as appropriate.
-
Change ownership:
Run the following command (as root) so Unit can access the application directory (If the application uses several directories, run the command for each one):
# chown -R unit:unit /path/to/app/ # User and group that Unit's router runs as by default
Note:
The unit:unit user-group pair is available only with official packages , Docker images, and some third-party repos. Otherwise, account names may differ; run theps aux | grep unitd
command to be sure.For further details, including permissions, see the security checklist.
-
Next, prepare the MoinMoin configuration for Unit (use real values for path):
{ "listeners": { "*:80": { "pass": "applications/moin" } }, "applications": { "moin": { "type": "python 2", "path": [ "/path/to/app/wsgi/module/", "/path/to/app/" ], "_comment_path": "Path where the WSGI module was stored at Step 4 | Path where the MoinMoin directory was extracted at Step 3", "module": "moin", "_comment_module": "WSGI file basename" } } }
-
Upload the updated configuration.
Assuming the JSON above was added to
config.json
. Run the following command as root:# curl -X PUT --data-binary @config.json --unix-socket \ /path/to/control.unit.sock \ # Path to Unit's control socket in your installation http://localhost/config/ # Path to the config section in Unit's control API
After a successful update, MoinMoin should be available on the listener’s IP address and port: