Skip to content

Commit

Permalink
Update setup for CentOS 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Apr 15, 2019
1 parent e505e6c commit 29866d5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 41 deletions.
31 changes: 21 additions & 10 deletions INSTALL.md
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`
16 changes: 0 additions & 16 deletions config/findingchart.conf

This file was deleted.

15 changes: 0 additions & 15 deletions config/findingchart.ini

This file was deleted.

12 changes: 12 additions & 0 deletions findingchart.ini
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

14 changes: 14 additions & 0 deletions findingchart.service
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

0 comments on commit 29866d5

Please sign in to comment.