This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMO ROOT EN /etc/nginx/sites-available/myapp | |
upstream myapp { | |
server 0.0.0.0:8000; | |
} | |
limit_req_zone $binary_remote_addr zone=admin:10m rate=1r/s; # 10MB DE ESPACIO PARA IP's QUE INTENTAN ENTRAR A /admin 1 SOLICITUD/s | |
include /etc/nginx/blockuseragents.rules; # SE INCLUYE EL ARCH PARA BLOQUEAR HTTP Agents | |
limit_conn_zone $binary_remote_addr zone=addr:5m; # LIMIT THE NUMBER OF CONNECTIONS BY IP IN NGINX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----> /bin/gunicorn_start.sh | |
#!/bin/bash | |
NAME="landingpage" # NOMBRE DE LA APLICACION | |
DJANGODIR=/home/<carpeta>/<carpeta>/landingpage # DIRECTORIO DEL PROYECTO DE DJANGO | |
# SOCKFILE=/webapps/hello_django/run/gunicorn.sock # TIPO DE SOCKET POR EL CUAL NOS COMUNICAREMOS UNIX | |
USER=<usuario> # EL USUARIO QUE VA A CORRER LA APP | |
GROUP=<grupo> # EL GRUPO AL QUE PERTENECE EL USUARIO QUE CORRE LA APP | |
NUM_WORKERS=1 # EL NUEMERO DE PROCESOS QUE CORRERA GUNICORN | |
DJANGO_SETTINGS_MODULE=<nombredeproyecto>.settings # QUE ARCHIVO DE SETTINGS OCUPARA DJANGO | |
DJANGO_WSGI_MODULE=<nombredeproyecto>.wsgi # NOMBRE DEL MODULO WSGI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMO ROOT EN /etc/supervisor/conf.d/myapp.conf | |
[program:myapp] | |
command=/bin/gunicorn_start.sh ; COMANDO PARA INICIAR LA APP | |
user=muebleria ; USUARIO QUE CORRE LA APP | |
stdout_logfile=/home/muebleria/LandingPage/landingpage/logs/supervisor.log ; DONDE SE ALACAMENA LOS LOGS DE LA APP | |
autostart=true ; AUTO INICIA LA APP | |
autorestart=true ; AUTO REINCIA LA APP | |
redirect_stderr=true ; SALVAR stderr EN EL MISMO LOG |
NewerOlder