首页 > 解决方案 > 找不到 gunicorn.socket 的工作

问题描述

我正在尝试在 digitalocean 上为我的 django 网站设置 gunicorn 但是

    sudo systemctl start gunicorn.socket

响应为“gunicorn.socket 的作业失败”。我已经仔细检查了任何拼写错误或目录路径问题。

我一直在关注本教程 - https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

文件路径 = /etc/systemd/system/gunicorn.service

[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=myuser
Group=www-data
WorkingDirectory=/home/myuser/profile_website
ExecStart=/home/myuser/profile_website/myenv/bin/gunicorn \
          --access-logfile - \
          --workers 3 \
          --bind unix:/run/gunicorn.sock \
          project2.wsgi:application

[Install]
WantedBy=multi-user.target

文件路径 = /etc/systemd/system/gunicorn.socket

[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target

我已经尝试重新启动 gunicorn.socket 但它不起作用。

标签: djangosocketsnginxpython-3.6gunicorn

解决方案


推荐阅读