我用gunicorn,nginx,supervisord部署我的django項目。 我在virtualenv上安裝了一個gunicorn,在INSTALL_APPS中添加。 命令./manage.py run_gunicorn -b 127.0.0.1:8999
作品:gunicorn:錯誤(沒有這樣的文件)nginx + gunicorn +主管
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:
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;
}
}
之後,我重啓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
我跑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/supectctl啓動之後,啓動了gunicorn。但我的網站不打開server_name(nginx.conf)中的地址。爲什麼? – Olga
在nginx.conf中更改listen 111111111:80;聽:80;然後重新啓動nginx。 – jordanvg