NGINX Unit

Bugzilla§

To run Bugzilla in Unit:

  1. Install NGINX. Currently, it is required to serve static files. Note the user settings in nginx.conf:

    user <user> <group>;
    
  2. Install Unit with the appropriate Perl language module version.

  3. Install Bugzilla prerequisites and source files.

    Note

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

  4. While running checksetup.pl, configure $webservergroup with the <group> value noted earlier.

  5. Prepare Unit configuration for your update. To obtain an initial template, query the control API:

    # curl --unix-socket /path/to/control.unit.sock \
           http://localhost/config/ > config.json
    

    Note

    Control socket path may vary; run unitd --help or see Startup for details.

    This creates a JSON file with Unit’s current settings. Edit the JSON file, adding a listener in listeners and pointing it to Bugzilla’s app.psgi file in applications. Bugzilla will run on the listener’s IP and port.

    {
        "listeners": {
            "127.0.0.1:8081": {
                "pass": "applications/bugzilla"
            }
        },
    
        "applications": {
            "bugzilla": {
                "type": "perl",
                "working_directory": "/path/to/bugzilla/",
                "script": "/path/to/bugzilla/app.psgi",
                "user": "<user>",
                "group": "<group>"
            }
        }
    }
    
  6. Upload the updated configuration:

    # curl -X PUT --data-binary @config.json --unix-socket \
           /path/to/control.unit.sock http://localhost/config
    
  7. Configure NGINX to serve .js and .css files, proxying other requests to Unit:

    server {
        listen 8080;
    
        location /data/assets/ {
            root /path/to/bugzilla/;
        }
    
        location / {
            proxy_pass http://127.0.0.1:8081;
            proxy_set_header Host $host;
        }
    }
    

    For details, refer to NGINX Admin Guide.

  8. Finally, browse to your Bugzilla site and complete the installation:

    Bugzilla in Unit - Setup Screen