加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

django – gunicorn:错误(没有这样的文件)nginx gunicorn主管

发布时间:2020-12-13 21:06:54 所属栏目:Nginx 来源:网络整理
导读:我用gunicorn,nginx,supervisord部署我的django项目. 我在virtualenv中安装了一个gunicorn,在INSTALL_APPS中添加了. 命令./manage.py run_gunicorn -b 127.0.0.1:8999有效: 2012-12-04 12:27:33 [21917] [INFO] Starting gunicorn 0.16.12012-12-04 12:27:3

我用gunicorn,nginx,supervisord部署我的django项目.
我在virtualenv中安装了一个gunicorn,在INSTALL_APPS中添加了.
命令./manage.py run_gunicorn -b 127.0.0.1:8999有效:

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 222221111: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)

该文件丢失了什么?我该如何部署我的项目?

最佳答案
对于未来的搜索者,我遇到了这个问题,问题是我需要提供Gunicorn二进制文件的完整路径.无论出于何种原因,即使使用PATH =环境变量,指定的supervisor也无法找到二进制文件.一旦我/ full_path / gunicorn它工作. (也许有办法用环境变量正确地做到这一点)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读