我正在build立一个ec2服务器,用ngnix和gunicorn来运行一个django项目。 服务器正在运行Amazon Linux。 当我从命令行运行启动gunicorn命令,它启动服务器,但是当我尝试从pipe理员运行它,我得到以下错误:
supervisor: couldn't chdir to /home/ec2-user/virtualenvs/wakeup-site/django-site: EACCES supervisor: child process was not spawned
当我以sudo身份运行supervisor或者以我自己的用户身份运行时会发生这种情况 目录权限:/ home / ec2-user / virtualenvs / wakeup-site / django-site
drwxrwxrwx 15 ec2-user ec2-user 4096 Mar 6 08:21 django-site
相关的Supervisor.conf文件:
[program:wakeup] command=./start_gunicorn.bash directory="/home/ec2-user/virtualenvs/wakeup-site/django-site" user=ec2-user autostart=true autorestart=true stdout_logfile=/home/ec2-user/virtualenvs/wakeup-site/django-site/logs/supervisorconf.log stderr_logfile=/home/ec2-user/virtualenvs/wakeup-site/django-site/logs/gunicorn_stderr.log
start_gunicorn.bash:
#!/bin/bash # Starts the Gunicorn server set -e # Activate the virtualenv for this project %(ACTIVATE)s # Start gunicorn going exec gunicorn wakeup.wsgi:application -c gunicorn.conf.py
我已经尝试从pipe理员删除目录行,只是使命令完整的path,尝试作为sudo运行,并删除ect2用户行与整个目录作为根。 当我跑步
exec gunicorn wakeup.wsgi:application -c gunicorn.conf.py
从命令行工作,我可以浏览到该网站。
有人可以帮忙吗?