gungorn, nginx, supervisord를 사용하여 장고 프로젝트를 배포합니다. INSTALL_APPS에 추가 된 virtualenv에 gunicorn을 설치했습니다. 명령 ./manage.py run_gunicorn -b 127.0.0.1:8999
작품 : 나는 nginx를 다시 시작 그 후gunicorn : 오류 (해당 파일 없음) nginx + gunicorn + 관리자
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;
}
}
:
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
nginx를 들어 나는 nginx.conf을 편집했다.
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
나는
bin/supervisorctl start all
을 달렸다. 하지만 :
gunicorn: ERROR (no such file)
어떤 파일이 있습니까? 프로젝트를 어떻게 배포 할 수 있습니까?
마십시오. 그러나 그것은 작동하지 않았다. – Olga
supervisord.conf를 편집하고 추가했습니다 :'command =/home/user/my_project/bin/gunicorn_django -w 4 -b 127.0.0.1:9999 -t 300 --max-requests = 1000 directory =/home/user/my_project/stratatech/stratatech/그 bin/supevisorctl이 모두 시작한 후에, gunicorn이 시작되었습니다. 하지만 내 사이트는 server_name (nginx.conf)의 주소를 열지 않습니다. 왜? – Olga
nginx.conf에서 변경 수신 111111111 : 80; 듣기 : 80; 그런 다음 nginx를 다시 시작하십시오. – jordanvg