Reputation: 633
every one I am trying to deploying django project using nginx gunicorn,,but when I run
sudo service gunicorn start, it said, start: Job failed to start,
the gunicorn.conf file
/etc/init/gunicorn.conf
description "Gunicorn application server handling myproject"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
setuid user
setgid www-data
chdir /home/parallels/books/mysite
exec myprojectenv/bin/gunicorn --workers 3 --bind unix:/home/parallels/books/mysite/mysite.sock mysite.wsgi:application
when I run
gunicorn --bind 0.0.0.0:8000 mysite.wsgi:application
I can see mysite running
but when I try
sudo service gunicorn start
fail,,, I just following the instruction here
any one who can reply thank you very much
Upvotes: 2
Views: 2804
Reputation: 4151
I know this is too late, but in any case:
setuid user
but there is user parallels
in your prompt (it depends of your bash settings, but probably it is name of curent user).chdir /home/parallels/books/mysite
and then exec myprojectenv/bin/gunicorn
and I guess your gunicorn location is not
/home/parallels/books/mysite/myprojectenv/bin/gunicorn
. So you need to use appropriate path to run gunicorn.Check gunicorn log file to find out problems. It should be here /var/log/upstart/gunicorn.log
Upvotes: 3
Reputation: 385
Check the exec command and its parameters. If you have any problem in that it will fail
In my case I missed bin after venv (virtual env) path. ie exec myprojectenv/bin/gunicorn --workers 3 --bind ...
Upvotes: 1
Reputation: 148
You need to update setuid user
to your user name and also the path.
Upvotes: 2