NGINX Unit
v. 1.24.0

Bugzilla§

To run the Bugzilla bug tracking system using Unit:

  1. Install Unit with a Perl language module.

  2. Install and configure Bugzilla’s prerequisites.

  3. Install Bugzilla’s core files. Here, we install it at /path/to/app/; use a real path in your configuration.

    Note

    Unit uses PSGI to run Perl applications; Bugzilla natively supports PSGI since version 5.1.

  4. Run the following command for each directory containing app code or data so Unit can access it:

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

  5. Next, prepare the Bugzilla configuration for Unit. The default .htaccess scheme roughly translates into the following (use real values for share, script, and working_directory):

    {
        "listeners": {
            "*:80": {
                "pass": "routes"
            }
        },
    
        "routes": [
            {
                "match": {
                    "source": "192.20.225.0/24",
                    "uri": "/data/webdot/*.dot"
                },
    
                "action": {
                    "share": "/path/to/app/"
                }
            },
            {
                "match": {
                    "uri": [
                        "!/data/assets/*.css",
                        "!/data/assets/*.js",
                        "!/data/webdot/*.png",
                        "!/graphs/*.gif",
                        "!/graphs/*.png",
                        "*.pl",
                        "*.pm",
                        "*.psgi",
                        "*.tmpl",
                        "*/cpanfile",
                        "*/localconfig*",
                        "/Bugzilla/*",
                        "/contrib/*",
                        "/data/*",
                        "/lib/*",
                        "/t/*",
                        "/template/*",
                        "/xt/*"
                    ]
                },
    
                "action": {
                    "return": 404
                }
            },
            {
                "action": {
                    "share": "/path/to/app/",
                    "fallback": {
                        "pass": "applications/bugzilla"
                    }
                }
            }
        ],
    
        "applications": {
            "bugzilla": {
                "type": "perl",
                "working_directory": "/path/to/app/",
                "script": "/path/to/app/app.psgi"
            }
        }
    }
    
  6. 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, browse to http://localhost and set up your Bugzilla installation:

    Bugzilla on Unit - Setup Screen