I am trying to configure django on nginx and gunicorn with these tutorials http://senko.net/en/django-nginx-gunicorn/ and http://honza.ca/2011/05/deploying-django-with-nginx-and-gunicorn
Setup:
virtualenv --no-site-packages qlimp cd qlimp source bin/activate pip install gunicorn django django-admin.py startproject qlimp cd qlimp python manage.py runserver 0.0.0.0:8001
Gunicorn setup is the same as here http://senko.net/en/django-nginx-gunicorn/
changes made (run.sh):
LOGFILE=/var/log/gunicorn/qlimp.log USER=nirmal GROUP=nirmal cd /home/nirmal/qlimp/qlimp
Upstart also matches the tutorial from the link above.
changes made:
exec /home/nirmal/qlimp/qlimp/run.sh
Configuring Nginx:
server { listen 80; server_name qlimp.com; access_log /home/nirmal/qlimp/log/access.log; error_log /home/nirmal/qlimp/log/error.log; location /static { root /home/nirmal/qlimp/qlimp; } location / { proxy_pass http://127.0.0.1:8888; }
}
Then I restarted nginx and started the gunicorn server:
sudo /etc/init.d/nginx restart (qlimp) cd qlimp/qlimp (qlimp) gunicorn_django -D -c run.sh
When I start the gunicorn server, I get this error:
Failed to read config file: run.sh Traceback (most recent call last): File "/home/nirmal/qlimp/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 65, in load_config execfile(opts.config, cfg, cfg) File "run.sh", line 3 LOGFILE=/var/log/gunicorn/qlimp.log ^ SyntaxError: invalid syntax
Can anyone guide me? Thanks!
source share