![]() |
ubuntu jeos 10.10 spamsnake Bad Gateway baruwa.sock
Yesterday I followed this guide and got stuck on the following.
In a browser i keep getting : 502 Bad Gateway What i'v read in the forums is that i could have multiple causes. I tried to eliminate them all. Now it is down to the fact that uwsgi doesn't correctly read the ini file. Here is the uwsgi startup line: (from ps ax) Code:
/usr/bin/uwsgi-python2.6 --master --no-orphans --processes 2 --logdate --chmod-socket=660 --uid www-data --gid www-data --daemonize /var/log/uwsgi/uwsgi-python2.6/baruwa.uwsgi-python2.6.log --pidfile /var/run/uwsgi/uwsgi-python2.6/baruwa/pid --socket /var/run/uwsgi/uwsgi-python2.6/baruwa/socket --ini /etc/uwsgi/uwsgi-python2.6/baruwa.iniCode:
socket = /var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sockMy uwsgi python log shows this: Code:
[uWSGI] getting YAML configuration from /etc/uwsgi/uwsgi-python2.6/baruwa.iniCode:
14:16:49 [crit] 2488#0: *1 connect() to unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.0.145Everything is according to the guide with default install of ubuntu server 10.10 I would greatly appreciate any pointers. Thx |
You are specifying the option --socket /var/run/uwsgi/uwsgi-python2.6/baruwa/socket on the command line which overrides the config file
|
Quote:
This is stated in the daemon options: Code:
# Default socket location: /var/run/uwsgi/uwsgi-python2.6/<confname>/socket |
Why the effort, there is nothing wrong with telling nginx there socket is /var/run/uwsgi/uwsgi-python2.6/baruwa/socket
|
Hey,
Looks like uwsgi is just skipping the socket statement and I'm sure you have /var/run/uwsgi/uwsgi-python2.6/baruwa directory created. Must have been some changes with the latest revision. Do as Andrew says and just point Nginx over to the socket. You should be fine from there. |
Quote:
and /etc/nginx/sites-enabled/baruwa.conf added: /var/run/uwsgi/uwsgi-python2.6/baruwa/socket Now I get a different error: Code:
uWSGI Error |
Do you have /etc/nginx/uwsgi_params?
Remember it has to be in this format in your nginx conf file: uwsgi_pass unix:////var/run/uwsgi/uwsgi-python2.6/baruwa/socket; |
Quote:
Code:
uwsgi_param QUERY_STRING $query_string;Code:
server {Any other suggestions, pulling my hair out over this. |
What version of uwsgi/nginx are you running?
So your uwsgi baruwa.ini should look like: [uwsgi] socket = /var/run/uwsgi/uwsgi-python2.6/baruwa/socket master = true processes = 2 env = DJANGO_SETTINGS_MODULE=baruwa.settings module = django.core.handlers.wsgi:WSGIHandler() Your nginx baruwa.conf should look like: server { listen 80; server_name yourhostname; root /usr/share/pyshared/baruwa; #main access log access_log /var/log/nginx/access.log; #main error log error_log /var/log/nginx/error.log; location /static { root /usr/share/pyshared/baruwa/static/; } # static resources location ~* ^.+\.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar |bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp| rtf|js)$ { expires 30d; break; } location /favicon.ico { return 204; } location / { uwsgi_pass unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/socket; include uwsgi_params; } } And with these settings, you're still not able to hit the site? Make sure and restart your system after making the configs to clear out any cache or so. Before you made changes to the conf and ini to /socket, uwsgi was running fine, it was just nginx that needed a pointer. If we can undo the changes, get uwsgi to work, maybe we'll be able to get nginx up by trying a few things with it. |
Quote:
and uWSGI 0.9.6.6 (64bit) I tried your settings, rebooted and got to the baruwa startup page!!! yeah! So great, thanks greatly for your help. I can continue now with the guide. Many thx Tuxic |
| All times are GMT +2. The time now is 00:30. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.