-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver_instructions
More file actions
52 lines (29 loc) · 1.15 KB
/
server_instructions
File metadata and controls
52 lines (29 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Clone repository to server
some instructions here: https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-14-04
create virtual environment: http://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/
cd WFB-simulation
virtualenv -p /usr/bin/python3.5 wfb-env
source wfb-env/bin/activate
Install packages
pip install -r requirements.txt
Verify that the app runs by itself on port 5000
python3 run_app.py
Verify gunicorn can bind and launch the app on port 8000
deactivate
gunicorn run_app:app --bind 0.0.0.0:8000
Move the WFB-simulation.conf file to /etc/init/:
sudo mv WFB_simulation.conf /etc/init/
Start application:
sudo start WFB-simulation
Edit the file /etc/nginx/sites-available/WFB-simulation to read:
server {
listen 80;
server_name 172.104.131.71;
location / {
include proxy_params;
proxy_pass http://unix:/home/bosefalk/WFB-simulation/WFB-simulation.sock;
}
}
Link it with the enabled sites and restart
sudo ln -s /etc/nginx/sites-available/WFB-simulation /etc/nginx/sites-enabled
sudo service nginx restart