-
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
4 changed files
with
42 additions
and
36 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,29 +1,35 @@ | ||
##### Notes for deploying on CentOS 7 | ||
|
||
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 a useful location and edit `findingchart.service` to point to it | ||
Copy `findingchart.service` to `/usr/lib/systemd/system/` | ||
|
||
Create a directory `/srv/sockets` and `chown nginx:nginx` it. | ||
|
||
Enable and start the `findingchart` service. | ||
|
||
Add to the nginx config | ||
``` | ||
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` | ||
##### Notes for deploying on CentOS 8 | ||
|
||
1. Install dependencies: `nginx`, `uwsgi` (python), `flask` (python), `github-flask` (python), `numpy` (python), `sep` (python), `pillow` (python) | ||
2. Clone the repository to a useful location | ||
3. Edit `findingchart.ini` to set `uid = ` your username | ||
4. Edit `findingchart.service` to point to set | ||
* `User=` your username | ||
* `WorkingDirectory=` project location | ||
|
||
5. Copy `findingchart.service` to `/usr/lib/systemd/system/` | ||
6. Add user to the `nginx` group: `sudo usermod -a -G <user> nginx` | ||
7. `chmod g+x` each directory in the path to the project | ||
8. Enable and start the service | ||
``` | ||
sudo systemctl start findingchart | ||
sudo systemctl enable findingchart | ||
``` | ||
9. Create / update nginx config to include: | ||
``` | ||
location /findingchart/static { | ||
alias <project path>/static; | ||
} | ||
location /findingchart/ { | ||
uwsgi_pass unix:<project path>/findingchart.sock; | ||
uwsgi_param SCRIPT_NAME /findingchart; | ||
include uwsgi_params; | ||
} | ||
``` | ||
10. Enable and start the `nginx` service. | ||
11. Open the firewall if needed | ||
``` | ||
sudo firewall-cmd --permanent --zone=public --add-service=http | ||
sudo firewall-cmd --reload` | ||
``` |
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,12 +1,11 @@ | ||
[uwsgi] | ||
socket = /srv/sockets/findingchart.sock | ||
socket = findingchart.sock | ||
chmod-socket=664 | ||
master = true | ||
mount = /findingchart=findingchart.py | ||
callable = app | ||
uid = nginx | ||
uid = {{USER}} | ||
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
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