From 693bfbe6f9e87ac5719efcdb9e10d3652331394b Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Thu, 20 Jun 2024 10:29:06 -0300 Subject: [PATCH 1/4] initial --- run.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/run.sh b/run.sh index a611829..864b4f5 100755 --- a/run.sh +++ b/run.sh @@ -290,7 +290,7 @@ update_debug() { # Install required packages install_packages() { dnf config-manager --set-enabled crb - dnf update && + dnf update -y && yum -y install vim && yum -y install epel-release && yum -y install bind-utils && @@ -416,6 +416,12 @@ server { server_name $PUB_IP; charset utf-8; client_max_body_size 75M; + server_tokens off; + + access_log /var/log/nginx/$APP.access.log; + error_log /var/log/nginx/$APP.error.log; + + location = /favicon.ico { access_log off; log_not_found off;} location /media { alias /home/$USERNAME/$APP/media; } @@ -471,17 +477,13 @@ create_service_file() { ====== [Unit] Description=$DESCRIPTION -After=syslog.target +After=network.target [Service] -ExecStart=/usr/local/bin/$SERVICE.sh -RuntimeDirectory=uwsgi -Restart=always -KillSignal=SIGQUIT -Type=notify -StandardError=syslog -NotifyAccess=all User=$USERNAME +Group=nginx +WorkingDirectory=/home/$USERNAME/$APP +ExecStart=/usr/local/bin/$SERVICE.sh [Install] WantedBy=multi-user.target @@ -494,10 +496,10 @@ fi # Criar o script que executa o modo Emperor do uWSGI # Create the script called by systemctl service -create_script_emperor() { +create_script_executor() { cat > /usr/local/bin/$SERVICE.sh < Date: Thu, 20 Jun 2024 11:04:09 -0300 Subject: [PATCH 2/4] fix: remove uwsgi from dependencies --- run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run.sh b/run.sh index 864b4f5..1cefc64 100755 --- a/run.sh +++ b/run.sh @@ -319,7 +319,6 @@ create_venv() { # Install project dependencies install_dependencies() { /home/$USERNAME/$APP/$VENV/bin/pip3 install --upgrade pip && - /home/$USERNAME/$APP/$VENV/bin/pip3 install uwsgi && /home/$USERNAME/$APP/$VENV/bin/pip3 install -r /home/$USERNAME/$APP/requirements.txt if [[ $? -ge 1 ]]; then update_step_error "$x" From e1b9669d1aa49e2df018bf9dc94fba85eeeabd7c Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Thu, 20 Jun 2024 11:04:24 -0300 Subject: [PATCH 3/4] update: service description --- centos.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/centos.conf b/centos.conf index 602685b..d9a475d 100755 --- a/centos.conf +++ b/centos.conf @@ -35,7 +35,7 @@ SERVICE="app.service" # Descrição do serviço no Systemctl # Systemctl service description -DESCRIPTION="Django VPS uWSGI Emperor" +DESCRIPTION="Django VPS" # Adicionar o certificado digital na aplicação com Certbot. Escreva sim, se já possuir um domínio na internet # Apply certbot ssl certificate, hit yes if you already have a domain From ac551141cbf90a5fc0f08212fbd88dd37af4afc4 Mon Sep 17 00:00:00 2001 From: "Lucas F." Date: Thu, 20 Jun 2024 11:50:55 -0300 Subject: [PATCH 4/4] update: remove uwsgi staff --- run.sh | 79 ++-------------------------------------------------------- 1 file changed, 2 insertions(+), 77 deletions(-) diff --git a/run.sh b/run.sh index 1cefc64..be6afbe 100755 --- a/run.sh +++ b/run.sh @@ -47,7 +47,7 @@ SERVICE="app.service" # Descrição do serviço no Systemctl # Systemctl service description -DESCRIPTION="Django VPS uWSGI Emperor" +DESCRIPTION="Django VPS" # Adicionar o certificado digital na aplicação com Certbot. Escreva sim, se já possuir um domínio na internet # Apply certbot ssl certificate, hit yes if you already have a domain @@ -364,51 +364,10 @@ enable_ports() { fi } -# Corrigir a configuração inicial do nginx -# Manage default nginx config file -manage_default_nginx_file() { - mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf~ && - cat > /etc/nginx/nginx.conf < /etc/nginx/conf.d/$APP.conf < /home/$USERNAME/$APP/uwsgi.ini <