NGINX Unit
v. 1.21.0

Review Board§

To run the Review Board code review tool using Unit:

  1. Install Unit with a Python 2.7 language module.

  2. Install and configure Review Board’s prerequisites.

    Note

    We’ll use Unit as the web server, so you can skip the corresponding step.

  3. Install the core files and create a site. Here, it’s /path/to/app/; use a real path in your configuration:

    $ rb-site install /path/to/app/
    
          * Welcome to the Review Board site installation wizard
    
              This will prepare a Review Board site installation in:
    
              /path/to/app
    
              We need to know a few things before we can prepare your site for
              installation. This will only take a few minutes.
              ...
    
  4. Add the .py extension to the WSGI module’s name to make it discoverable by Unit, for example:

    $ mv /path/to/app/htdocs/reviewboard.wsgi /path/to/app/htdocs/wsgi.py
    
  5. Set installation path permissions to secure access, for example:

    # chown -R app_user:app_group /path/to/app/
    

    Update the placeholders above with actual values, noting them for later use in Unit configuration.

    Also, make sure the following directories are writable:

    $ chmod u+w /path/to/app/htdocs/media/uploaded/
    $ chmod u+w /path/to/app/data/
    
  6. Next, put together the Review Board configuration for Unit:

    {
        "listeners": {
            "*:80": {
                "pass": "routes/rb"
            }
        },
    
        "routes": {
            "rb": [
                {
                    "match": {
                        "uri": [
                            "/media/*",
                            "/static/*",
                            "/errordocs/*"
                        ]
                    },
    
                    "action": {
                        "share": "/path/to/app/htdocs/"
                    }
                },
                {
                    "action": {
                        "pass": "applications/rb"
                    }
                }
            ]
        },
    
        "applications": {
            "rb": {
                "type": "python 2",
                "user": "app_user",
                "group": "app_group",
                "path": "/path/to/app/htdocs/",
                "module": "wsgi"
            }
        }
    }
    
  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 --help or see Startup for details.

    After a successful update, browse to http://localhost and set up your Review Board installation:

    Review Board on Unit - Dashboard Screen