HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   The Perfect SpamSnake - Ubuntu Jeos 10.10 Maverick Meerkat (http://www.howtoforge.com/forums/showthread.php?t=50330)

tahussle 2nd December 2010 20: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

http://www.howtoforge.com/the-perfec...ick-meerkat-p4

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

502 Bad Gateway

--------------------------------------------------------------------------------

nginx/0.8.53




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

shows

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


any help appreciated

Rocky 2nd December 2010 23:01

Hey,

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 2nd December 2010 23:39

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

[uwsgi]
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
nginx.




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


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

Rocky 3rd December 2010 02:32

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

/var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock

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 12:06

thanks
 
cheers all working


All times are GMT +2. The time now is 06:42.

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