-
Notifications
You must be signed in to change notification settings - Fork 0
/
host_config.txt
64 lines (47 loc) · 1.47 KB
/
host_config.txt
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
53
54
55
56
57
58
59
60
61
62
63
64
https://medium.com/@srijan.pydev_21998/complete-guide-to-deploy-django-applications-on-aws-ubuntu-16-04-instance-with-uwsgi-and-nginx-b9929da7b716
uwsgi --http :8000 --home /home/ubuntu/mirquest2_venv/ --chdir /home/ubuntu/mirquest2-api/ --module mirquest.wsgi
## mirquest2-api.ini ##
[uwsgi]
project = mirquest2-api
uid = ubuntu
base = /home/%(uid)
chdir = %(base)/%(project)
home = %(base)/mirquest2_venv
module = mirquest.wsgi:application
master = true
processes = 5
socket = %(base)/%(project).sock
chown-socket = %(uid):www-data
chmod-socket = 666
vacuum = true
## Service ##
[Unit]
Description=uWSGI Emperor service
[Service]
ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown ubuntu:www-data /run/uwsgi'
ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all
[Install]
WantedBy=multi-user.target
## nginx config ##
server {
listen 8000;
server_name 54.85.174.85;
client_max_body_size 11M;
location = /favicon.ico {access_log off; log_not_found off; }
location = /static/ {
root /home/ubuntu/mirquest2-api/mirquest/static;
}
location = /files/ {
root /home/ubuntu/mirquest2-api/files;
}
location / {
include /etc/nginx/uwsgi_params;
uwsgi_pass unix:///home/ubuntu/mirquest2-api.sock;
}
}
## link available to enabled nginx site ##
sudo ln -s /etc/nginx/sites-available/mirquest2-api /etc/nginx/sites-enabled/mirquest2-api