From a402c1e0911206f0ec4675de5f38162b14ea00e1 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Fri, 11 Nov 2022 16:38:53 -0500 Subject: [PATCH] add script install app trytond uwsgi --- install_app_trytond_uwsgi.sh | 144 +++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 install_app_trytond_uwsgi.sh diff --git a/install_app_trytond_uwsgi.sh b/install_app_trytond_uwsgi.sh new file mode 100644 index 0000000..8051b70 --- /dev/null +++ b/install_app_trytond_uwsgi.sh @@ -0,0 +1,144 @@ +#!/bin/bash + +#--------------------------------------------------------- +# Script Install Tryton uswgi for Home Intance +# -------------------------------------------------------- + + +mkdir /etc/uwsgi +mkdir /etc/uwsgi/vassals +file_location=/etc/uwsgi/vassals/trytond.ini +if [ -f "$file_location" ]; then + echo "File $file_location already exists!" +else + cat > $file_location < $file_location2 < $file_location3 </static; # your Django project's static files - amend as required + #} + + # Finally, send all non-media requests to the Django server. + location / { + add_header 'Access-Control-Allow-Origin' '*'; + include uwsgi_params; # the uwsgi_params file you installed + uwsgi_param REMOTE_USER $remote_user; + uwsgi_param DATE_GMT $date_gmt; + uwsgi_param DATE_LOCAL $date_local; + uwsgi_param AUTH_TYPE Basic; + uwsgi_read_timeout 600s; + uwsgi_pass trytond; + } + + location /status_server { + stub_status on; + allow 127.0.0.1; + deny all; + } +} + + +EOF +fi + +ln -s /etc/nginx/sites-available/trytond /etc/nginx/sites-enabled/ + +systemctl enable trytond_uwsgi.service +systemctl start trytond_uwsgi.service +systemctl stop nginx +systemctl start nginx