我正在尝试在 Ubuntu 20.04 上设置 uWSGI,我正在尝试创建一个 systemctld 单元文件,但我无法启动该服务。
命令:
sudo systemctl start myproject
sudo systemctl status myproject
输出:
● myproject.service - uWSGI instance to serve myproject.dev
Loaded: loaded (/etc/systemd/system/myproject.service; enabled; vendo>
Active: failed (Result: exit-code) since Fri 2022-01-28 12:58:36 UTC; 16s >
Main PID: 19524 (code=exited, status=1/FAILURE)
/etc/systemd/system/myproject.service
[Unit]
Description=uWSGI instance to serve myproject.dev
After=network.target
[Service]
User=max
Group=www-data
WorkingDirectory=/var/www/myproject.dev
Environment="PATH=/var/www/myproject.dev/myenv/bin"
ExecStart=/var/www/myproject.dev/myenv/bin/uwsgi --ini myproject.ini
[Install]
WantedBy=multi-user.target
我真的被这个问题难住了,有人能帮我指出正确的方向吗?
答案1
我通过以下方式修复了这个问题:
sudo chmod -R g+ws /var/www/myproject.dev
sudo chgrp -R www-data /var/www/myproject.dev