Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
Add Gunicorn requirement blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
thatmattlove committed Jun 19, 2019
1 parent aedb66a commit d139430
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions docs/installation/wsgi.md
@@ -1,25 +1,23 @@
For production builds, you'll want to have a real WSGI front end instead of the built in Flask developer web server. For time's sake, Ubuntu 18.04 instructions are provided. That said, this is a pretty generic setup and should be easily replicable to other platforms.
For production builds, you'll want to have a real WSGI front end instead of the built in Flask developer web server. While any WSGI could be used, [Gunicorn](https://gunicorn.org/) is the recommended and default WSGI for hyperglass.

## Gunicorn Installation
!!! info "Alternative WSGIs"
If you choose to use a different WSGI, be sure to look closely at `hyperglass/hyperglass/gunicorn_config.py.example` to properly replicate configurations for Prometheus metrics with multiple workers, single-worker Sass compilation, and Redis testing.

[Gunicorn](https://gunicorn.org/) is a WSGI server written in Python.

### Install
```console
$ pip3 install gunicorn
```

### Configure
## Configure

Migrate the example Gunicorn configuration file:

```console
$ cd /opt/hyperglass/
$ python3 manage.py migrate-gunicorn
```

Open `hyperglass/hyperglass/gunicorn_config.py`, and adjust the parameters to match your local system. For example, make sure the `command` parameter matches the location of your `gunicorn` executable (`which gunicorn`), the `pythonpath` parameter matches the location where hyperglass is installed, and that the `user` parameter matches the user you're running hyperglass as.

#### Permissions
!!! warning "Reverse Proxy Required"
Gunicorn is not designed to be a front-end web server, and therefore requires the use of a reverse proxy of some kind. The Gunicorn development team recommends the use of [NGINX](https://www.nginx.com/), for which [installation instructions have been provided](../reverseproxy).

### Permissions

Gunicorn requires read/write/executable access to the entire `hyperglass/hyperglass` directory in order to read its configuration and execute the python code. If running gunicorn as `www-data`, fix permissions with:

Expand All @@ -28,5 +26,5 @@ Gunicorn requires read/write/executable access to the entire `hyperglass/hypergl
# python3 manage.py update-permissions --user <user> --group <group>
```

!!! note "File Ownership"
!!! info "File Ownership"
If the `--user` and `--group` options are not specified, `www-data` will be used.

0 comments on commit d139430

Please sign in to comment.