Skip to content
Snippets Groups Projects
Commit 3f6c257b authored by David Trattnig's avatar David Trattnig
Browse files

More documentation on server setup.

parent f50bd04b
No related branches found
No related tags found
No related merge requests found
......@@ -130,7 +130,17 @@ sudo mysql -u root -p < contrib/mariadb-database.sql
### Configuration
Copy the sample configuration file in `./config/sample/sample-production.engine-api` to `config` and edit the file.
First update the main configuration and then configure the type of federation. Depending on how you want to run your
First update the main configuration, such as your database connection and the default port. Also set the correct IP
and port in `gunicorn.conf.py` file.
> You might alos need to 'open' the chosen port in your `iptables` (Default is 8008)
```shell
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 8008 -j ACCEPT
```
Then configure the type of federation. Depending on how you want to run your
Engine API node and where it is deployed, you'll needed to uncomment one of these federation sections:
> To avoid any malfunction it is important that any other node-type configurations are commented out.
......@@ -193,6 +203,10 @@ To run the API in an local development server execute:
For convenience running a plain `./run.sh` also starts the development server.
In development mode Engine uses the default [Flask](https://palletsprojects.com/p/flask/) web server.
**Please be careful not to use this type of server in your production environment!**
When you'll need to run all three nodes to do testing during development you can run:
```bash
......@@ -205,7 +219,16 @@ Here the run script uses the configurations located in `./test/config`.
### Production
To run the server for production using Gunicorn, you first need to create the Gunicorn configuration
For production Engine API defaults to using the WSGI HTTP Server [`Gunicorn`](https://gunicorn.org/).
You might also want to pair Gunicorn with some proxy server, such as Nginx.
> Although there are many HTTP proxies available, we strongly advise that you use Nginx. If you choose another proxy
server you need to make sure that it buffers slow clients when you use default Gunicorn workers. Without this buffering
Gunicorn will be easily susceptible to denial-of-service attacks. You can use Hey to check if your proxy is behaving properly.
[**Gunicorn Docs**](http://docs.gunicorn.org/en/latest/deploy.html).
To run Gunicorn, you first need to create the Gunicorn configuration
by copying the sample `./config/sample/gunicorn/sample-production.gunicorn.conf.py`
to your `config` directory.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment