The Perfect SpamSnake - Ubuntu Jeos 10.10 Maverick Meerkat

Discussion in 'HOWTO-Related Questions' started by tahussle, Dec 2, 2010.

  1. tahussle

    tahussle New Member

    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
  2. Rocky

    Rocky Member


    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
  3. tahussle

    tahussle New Member

    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;
  4. Rocky

    Rocky Member

    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.
    Last edited: Dec 3, 2010
  5. tahussle

    tahussle New Member


    cheers all working

Share This Page