Distribuisco il mio progetto django con gunicorn, nginx, supervisord. Ho installato un gunicorn in virtualenv, aggiunto in INSTALL_APPS. Il comando ./manage.py run_gunicorn -b 127.0.0.1:8999
opere:gunicorn: ERRORE (nessun file simile) nginx + gunicorn + supervisore
2012-12-04 12:27:33 [21917] [INFO] Starting gunicorn 0.16.1
2012-12-04 12:27:33 [21917] [INFO] Listening at: http://127.0.0.1:8999 (21917)
2012-12-04 12:27:33 [21917] [INFO] Using worker: sync
2012-12-04 12:27:33 [22208] [INFO] Booting worker with pid: 22208
Per nginx ho modificato nginx.conf:
server {
listen 111111111:80;
server_name my_site.pro;
access_log /home/user/logs/nginx_access.log;
error_log /home/user/logs/nginx-error.log;
location /static/ {
alias /home/user/my_project/static/;
}
location /media/ {
alias /home/user/my_project/media/;
}
location/{
proxy_pass http://127.0.0.1:8999;
include /etc/nginx/proxy.conf;
}
}
Dopo che ho riavviato nginx.
supervisord.conf:
[unix_http_server]
file=/tmp/supervisor-my_project.sock
chmod=0700
chown=user:user
[supervisord]
logfile=/home/user/logs/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/tmp/supervisord-my_project.pid
nodaemon=false
minfds=1024
minprocs=200
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///tmp/supervisor-my_project.sock
[program:gunicorn]
command=/home/user/bin/manage run_gunicorn -w 4 -b 127.0.0.1:8999 -t 300 --max- requests=1000
startsecs=10
stopwaitsecs=60
redirect_stderr=true
stdout_logfile=/home/user/gunicorn.log
mi sono imbattuto bin/supervisorctl start all
. Ma ho ottenuto:
gunicorn: ERROR (no such file)
Che file manca? Come posso distribuire il mio progetto?
ho provato. Ma non ha funzionato. – Olga
Ho modificato supervisord.conf e aggiunto: 'comando =/home/utente/mio_project/bin/gunicorn_django -w 4 -b 127.0.0.1:9999 -t 300 --max-requests = 1000 directory =/home/utente/my_project/stratatech/stratatech/E dopo che bin/supevisorctl ha iniziato tutto, è stato avviato gunicorn. Ma il mio sito non si apre sull'indirizzo in nome_server (nginx.conf). Perché? – Olga
In nginx.conf cambia l'ascolto 111111111: 80; ascoltare: 80; quindi riavviare nginx. – jordanvg