我使用的是Django 1.8,我想用gunicorn来运行我的应用程序。
我可以通过绑定到我的IP的命令行运行它:
gunicorn myapp.wsgi:application --bind xx.xx.xx.xx:8001但现在我想通过Unix套接字运行它:
gunicorn myapp.wsgi:application --bind=unix$/webapps/myapp/run/gunicorn.sock我得到了这个错误:
[2015-08-23 07:38:04 +0000] [18598] [INFO] Starting gunicorn 19.3.0
[2015-08-23 07:38:04 +0000] [18598] [ERROR] Retrying in 1 second.
[2015-08-23 07:38:05 +0000] [18598] [ERROR] Retrying in 1 second.
[2015-08-23 07:38:06 +0000] [18598] [ERROR] Retrying in 1 second.
[2015-08-23 07:38:07 +0000] [18598] [ERROR] Retrying in 1 second.
[2015-08-23 07:38:08 +0000] [18598] [ERROR] Retrying in 1 second.
[2015-08-23 07:38:09 +0000] [18598] [ERROR] Can't connect to $/webapps/myapp/run/gunicorn.sock如果我执行ls -al /webapps/myapp/run,我会看到套接字文件确实存在,尽管它是空的:
srwxrwxrwx 1 opuser webapps 0 Aug 23 07:22 /webapps/myapp/run/gunicorn.sock我该如何解决这个问题呢?
我最终希望以opuser用户的身份运行gunicorn,我尝试将--user opuser --group webapps附加到gunicorn命令,但仍然得到相同的错误。
发布于 2015-08-23 21:16:28
根据文档(http://gunicorn-docs.readthedocs.org/en/latest/run.html),您应该使用:unix:$(PATH),这意味着您的命令应该是:
gunicorn myapp.wsgi:application --bind=unix:/webapps/myapp/run/gunicorn.sock发布于 2019-01-10 20:11:27
删除venv/run文件夹,然后在不使用sudo的情况下删除mkdir run
https://stackoverflow.com/questions/32166270
复制相似问题