HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   HOWTO-Related Questions (
-   -   The Perfect SpamSnake - Ubuntu Jeos 10.10 Maverick Meerkat (

tahussle 2nd December 2010 21:40

The Perfect SpamSnake - Ubuntu Jeos 10.10 Maverick Meerkat
502 Bad Gateway - nginx&baruwa


Hi i am trying to setup a spam snake as per the link below. the instructions is not the clearest but i have tried to follow word for word

however when i try to log into the front end i get

502 Bad Gateway



tail -f /var/log/nginx/error.log


connect() to unix:///var/run/baruwa.sock failed (2: No such file or directory) while connecting to upstream

any help appreciated

Rocky 3rd December 2010 00:01


Whats the content of /etc/uwsgi/uwsgi-python2.6/baruwa.ini?

Try running /etc/init.d/uwsgi-python2.6 restart and try hitting the site.

If that fails, what happens when you do this: /etc/init.d/nginx restart

tahussle 3rd December 2010 00:39

hi thanks for the reply
this is the content of /etc/uwsgi/uwsgi-python2.6/baruwa.ini

socket = /var/run/baruwa.sock
master = true
processes = 2
env = DJANGO_SETTINGS_MODULE=baruwa.settings
module = django.core.handlers.wsgi:WSGIHandler()

and on running the restart same problem
spamsnake:/etc/nginx/sites-enabled# /etc/init.d/uwsgi-python2.6 restart
* Restarting WSGI server(s) uwsgi-python2.6 [ OK ]

**@spamsnake:/etc/nginx/sites-enabled# /etc/init.d/nginx restart
Restarting nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
configuration file /etc/nginx/nginx.conf test is successful

and this is the baruwa.conf file in the nginx sites-enabled folder

server {
listen 80;
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;
location / {
uwsgi_pass unix:///var/run/baruwa.sock;
include uwsgi_params;

Rocky 3rd December 2010 03:32

Please change the socket line in /etc/uwsgi/uwsgi-python2.6/baruwa.ini and /etc/nginx/sites-enabled/baruwa.conf to:


Restart both uwsgi-python2.6 and nginx and you should be good to go.

That should take care of the issues you're having.

tahussle 3rd December 2010 13:06

cheers all working

All times are GMT +2. The time now is 02:00.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.