NGINX Unit

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:

  1. 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.

  2. Install and configure MoinMoin’s prerequisites.

  3. Install MoinMoin’s core files. Here, we install it 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/
    
  4. Configure your wiki instances:

    See the ‘Single Wiki’ section here for an explanation of these commands:

    $ cd /path/to/app/
    
    $ mkdir single/
    
    $ cp wiki/config/wikiconfig.py single/
    
    $ cp -r wiki/data/ single/data/
    
    $ cp -r wiki/underlay/ single/underlay/
    
    $ cp wiki/server/moin.wsgi single/moin.py
    

    Next, edit the wiki instance configuration in wikiconfig.py as appropriate.

    See the ‘Multiple Wikis’ section here for an explanation of these commands:

    $ cd /path/to/app/
    
    $ mkdir multi/ multi/wiki1/ multi/wiki2/
    
    $ cp wiki/config/wikifarm/* multi/
    
    $ cp wiki/config/wikiconfig.py multi/wiki1.py
    
    $ cp wiki/config/wikiconfig.py multi/wiki2.py
    
    $ 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
    

    Next, edit the farm configuration in farmconfig.py and the wiki instance configurations, shown here as wiki1.py and wiki2.py, as appropriate.

  5. Run the following command so Unit can access the application directory:

    # chown -R unit:unit /path/to/app/
    

    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 the ps aux | grep unitd command to be sure.

    For further details, including permissions, see the security checklist.

  6. 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/",
                ],
    
                "module": "moin"
            }
        }
    }
    
  7. Upload the updated configuration. Assuming the JSON above was added to config.json:

    # curl -X PUT --data-binary @config.json --unix-socket \
           /path/to/control.unit.sock http://localhost/config/
    

    Note

    The control socket path may vary; run unitd -h or see Startup and Shutdown for details.

    After a successful update, MoinMoin should be available on the listener’s IP address and port:

    Moin on Unit - Welcome Screen