-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
47 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
##### Notes for deploying on OpenSUSE | ||
##### Notes for deploying on CentOS 7 | ||
|
||
Install nginx, uwsgi, uwsgi-python3 packages (need server repo enabled). | ||
Add the `epel` repository and install the `nginx`, `uwsgi`, `uwsgi-python36` packages. | ||
Install the python dependencies `python36-numpy`, `python36-Pillow`, `python36-Flask`, `python36-sep` | ||
|
||
Clone the repository to /srv/findingchart/appdata/ and chown -R nginx:nginx | ||
Move config/findingchart.ini to /etc/uwsgi/vassals/ (uWSGI Emperor config file) | ||
Move config/findingchart.conf to /etc/nginx/conf.d/ (nginx config file) | ||
Clone the repository to a useful location and edit `findingchart.service` to point to it | ||
Copy `findingchart.service` to `/usr/lib/systemd/system/` | ||
|
||
Open port 80 in the firewall by setting `FW_SERVICES_EXT_TCP="80"` in /etc/sysconfig/SuSEfirewall2 | ||
Create a directory `/srv/sockets` and `chown nginx:nginx` it. | ||
|
||
Enable and start services | ||
Enable and start the `findingchart` service. | ||
|
||
Add to the nginx config | ||
``` | ||
systemctl enable nginx uwsgi | ||
systemctl start nginx uwsgi | ||
systemctl restart SuSEfirewall2 | ||
location = /findingchart { rewrite ^ /findingchart/; } | ||
location /findingchart/static { | ||
alias {{PROJECT_PATH}}/static; | ||
} | ||
location /findingchart/ { | ||
uwsgi_pass unix:/srv/sockets/findingchart.sock; | ||
uwsgi_param SCRIPT_NAME /findingchart; | ||
include uwsgi_params; | ||
} | ||
``` | ||
|
||
Enable and start the `nginx` service. | ||
Open the firewall if needed `sudo firewall-cmd --permanent --zone=public --add-service=http && sudo firewall-cmd --reload` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[uwsgi] | ||
socket = /srv/sockets/findingchart.sock | ||
master = true | ||
mount = /findingchart=findingchart.py | ||
callable = app | ||
uid = nginx | ||
gid = nginx | ||
processes = 1 | ||
threads = 1 | ||
plugins = python36 | ||
manage-script-name = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=uWSGI server for Finding Chart generator | ||
After=network.target | ||
|
||
[Service] | ||
User=nginx | ||
Group=nginx | ||
WorkingDirectory={{PROJECT_DIR}}} | ||
ExecStart=/usr/sbin/uwsgi --ini findingchart.ini | ||
ExecReload=/bin/kill -HUP $MAINPID | ||
KillSignal=SIGINT | ||
|
||
[Install] | ||
WantedBy=multi-user.target |