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