Update uwsgi setup

This commit is contained in:
lhark 2020-07-24 18:45:11 -04:00
parent a5a4f21b2d
commit 031a6e929e

26
how_to
View file

@ -465,11 +465,13 @@ Root Samsung GT-S7275R "Ace 3" :
https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-14-samsung-t3468084 https://forum.xda-developers.com/ace-3/development/gt-s7275r-b-t-cyanogenmod-14-samsung-t3468084
Nginx + uwsgi: Nginx + uwsgi:
$ pacman -S nginx (nginx-runit) uwsgi uwsgi-plugin-python
/etc/ /etc/
nginx/ nginx/
nginx.conf nginx.conf
uwsgi_params uwsgi_params
uwsgi/ uwsgi/
emperor.ini
vassals/ vassals/
yoursite.ini yoursite.ini
/var/ /var/
@ -481,16 +483,20 @@ Nginx + uwsgi:
yoursite.sock yoursite.sock
Create www-data Create www-data
useradd -r -s /usr/bin/nologin -U www-data useradd -r -s /usr/bin/nologin -U www-yoursite
Setup uwsgi daemon with cmd :
uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data
nginx.conf: nginx.conf:
user www-data www-data;
server { server {
listen 80; listen 80;
server_name your.site;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
root /var/www/yoursite/; root /var/www/yoursite/;
server_name your.site; server_name your.site;
ssl_certificate <path>/fullchain.pem;
ssl_certificate_key <path>/privkey.pem;
location / { try_files $uri @yoursite; } location / { try_files $uri @yoursite; }
location @yoursite { location @yoursite {
include uwsgi_params; include uwsgi_params;
@ -503,16 +509,16 @@ Nginx + uwsgi:
chdir = /var/www/yoursite chdir = /var/www/yoursite
module = yourapp:app # Flask example module = yourapp:app # Flask example
socket = /tmp/yoursite.sock socket = /tmp/yoursite.sock
chmod-socket = 644 uid = www-yoursite
gid = http # or nginx user
chmod-socket = 664
vacuum = true vacuum = true
home = /var/www/.virtualenvs/yourvirtualenv (home = /var/www/.virtualenvs/yourvirtualenv)
plugin = python(3) plugin = python(3)
(die-on-term = true) (die-on-term = true)
Voidlinux: runit:
mkdir /etc/sv/uwsgi echo "exec uwsgi --ini /etc/uwsgi/emperor.ini --logto /var/log/uwsgi.log" > /etc/sv/uwsgi/run
echo "exec uwsgi --emperor /etc/uwsgi/vassals ..." > /etc/sv/uwsgi/run
ln -s /etc/sv/uwsgi /var/services
Easy LaTeX compilation: Easy LaTeX compilation:
$ trizen -S tectonic $ trizen -S tectonic