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.

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

  5. 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
       
    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/"
                ],
                "_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"
          }
       }
    }
  7. 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
       
    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


Last modified February 6, 2025