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)
-   -   Ubuntu 10.10 SpamSnake .. 502 Bad Gateway (http://www.howtoforge.com/forums/showthread.php?t=51263)

RoboBunny 4th February 2011 12:57

Ubuntu 10.10 SpamSnake .. 502 Bad Gateway
 
Hi

I followed Rocky's
http://www.howtoforge.com/the-perfec...ick-meerkat-p3

Now when I try to go to the webpage i get 502 Bad Gateway.

http://192.168.1.252:8080/accounts/login/?next=/

Not displaying BARUWA website I did check....
http://www.howtoforge.com/forums/showthread.php?t=50330
it did not help..

tail -f /var/log/nginx/error.log
**
2011/02/04 13:34:21 [error] 25272#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.252, server: mail.mysite.co.za, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "mail.mysite.co.za:8080"

2011/02/04 13:46:26 [error] 25272#0: *4 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.252, server: mail.mysite.co.za, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "192.168.1.252:8080"

2011/02/04 13:46:26 [error] 25272#0: *4 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.1.252, server: mail.mysite.co.za, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.252:8080"

2011/02/04 13:46:29 [error] 25272#0: *4 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.1.252, server: mail.mysite.co.za, request: "GET /favicon.ico HTTP/1.1", host: "192.168.1.252:8080"

2011/02/04 13:49:24 [error] 25272#0: *7 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.252, server: mail.mysite.co.za, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "192.168.1.252:8080"
**

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

**
92.168.1.252 - - [04/Feb/2011:13:46:26 +0200] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
192.168.1.252 - - [04/Feb/2011:13:46:26 +0200] "GET /accounts/login/?next=/ HTTP/1.1" 502 172 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
192.168.1.252 - - [04/Feb/2011:13:46:26 +0200] "GET /favicon.ico HTTP/1.1" 404 142 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
192.168.1.252 - - [04/Feb/2011:13:46:29 +0200] "GET /favicon.ico HTTP/1.1" 404 142 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
192.168.1.252 - - [04/Feb/2011:13:49:24 +0200] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
192.168.1.252 - - [04/Feb/2011:13:49:24 +0200] "GET /accounts/login/?next=/ HTTP/1.1" 502 172 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
**

tail -f /var/log/nginx/localhost.access.log

**
::1 - - [04/Feb/2011:10:06:20 +0200] "GET / HTTP/1.1" 403 143 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
::1 - - [04/Feb/2011:10:08:23 +0200] "GET / HTTP/1.1" 403 143 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
::1 - - [04/Feb/2011:13:22:59 +0200] "GET /accounts/login/?next=/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
::1 - - [04/Feb/2011:13:34:08 +0200] "GET /accounts/login/?next=/ HTTP/1.1" 404 143 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
::1 - - [04/Feb/2011:13:34:12 +0200] "GET / HTTP/1.1" 403 143 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10"
**

I got the following that is why I'm running on port 8080:
root@mail:/usr/src# /etc/init.d/uwsgi-python2.6 restart && /etc/init.d/nginx restart
* Restarting WSGI server(s) uwsgi-python2.6 [ OK ]
Restarting nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
nginx.

I did double check for same problem form other people but no luck.

Please if anyone can help I would greatly appreciate it

RoboBunny

Rocky 4th February 2011 16:09

Do you by chance have any other web servers running?

RoboBunny 8th February 2011 22:40

Ubuntu 10.10 SpamSnake .. 502 Bad Gateway
 
Thanks for the reply Rocky.

I managed to get it working but its not exactly what I was looking for.
Can I ask you a favor? Would you mind doing a "How to" for the setup of a
Ubuntu 10.10 or CentOS 5.5 with virtual users etc....:

Apache + Postfix + Mysql + Postfix Admin + Dovecot + MailScanner + Mailwatch + Sqlgrey + SpamAssassin + Clamav + Squirrelmail
------> http://www.example42.com/puppet/toaster-mailscanner.php

Or just a "How to" for a MailScanner setup (Ubuntu 10.10 or CentOS 5.5)
Apache + Postfix + Mysql + Dovecot + MailScanner + Mailwatch + SpamAssassin + Clamav

I need to pull mail from a external pop/imap server (like google, local ISP or pop.mailserver.com) for local or virtual users, the mail should be able to route internally and if not found relay to a external smtp server (like google, local ISP or smtp.mailserver.com)... but i want to use mailscanner with mail watch or baruwa for scanning mails and i need apache for another site configured for apache virtual host.

:) Please Rockey :)
I know I'm asking alot and hope you will consider this task if and when you have time.

Thanks RoboBunny. :)

chewbacca 24th February 2011 19:28

Hello,

i am encountering error above, but restarting the webserver doesn´t give me an error
Code:

tail -f /var/log/nginx/error.log
2011/02/24 19:14:30 [error] 17889#0: *1 upstream prematurely closed connection while reading response header from upstream, client: 192.168.200.206, server: mail.example.de, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "192.168.xxx.xxx"
2011/02/24 19:14:30 [error] 17889#0: *1 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "192.168.200.19"
2011/02/24 19:14:30 [error] 17889#0: *1 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "192.168.200.19"
2011/02/24 19:14:33 [error] 17889#0: *1 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "192.168.200.19"
2011/02/24 19:19:25 [error] 17889#0: *4 upstream prematurely closed connection while reading response header from upstream, client: 192.168.200.206, server: mail.example.de, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "server"
2011/02/24 19:19:25 [error] 17889#0: *4 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "server"
2011/02/24 19:19:25 [error] 17889#0: *4 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "server"
2011/02/24 19:19:28 [error] 17889#0: *4 open() "/usr/share/pyshared/baruwa/favicon.ico" failed (2: No such file or directory), client: 192.168.200.206, server: mail.example.de, request: "GET /favicon.ico HTTP/1.1", host: "server"
2011/02/24 19:20:32 [error] 17889#0: *4 upstream prematurely closed connection while reading response header from upstream, client: 192.168.200.206, server: example.de, request: "GET /accounts/login/?next=/ HTTP/1.1", upstream: "uwsgi://unix:///var/run/uwsgi/uwsgi-python2.6/baruwa/baruwa.sock:", host: "server"

Code:

/etc/init.d/uwsgi-python2.6 restart && /etc/init.d/nginx restart
 * Restarting WSGI server(s) uwsgi-python2.6                                                                                                          [ OK ]
Restarting nginx: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
nginx.


Rocky 24th February 2011 23:10

Hi,

Is this a fresh install or upgrade? Make sure /usr/share/pyshared/baruwa/settings.py contains the correct db login infomation.

chewbacca 25th February 2011 10:22

Hello,

trhis is a fresh install i tested the baruwa mysql password with

Code:

mysql -u baruwa -p
and it matched the pw in the settings.py

chewbacca 25th February 2011 11:17

Hello,

i got it working after i dropped the baruwa database and recreated it.

Rocky 25th February 2011 13:13

Great! Must have been a screwy db install.


All times are GMT +2. The time now is 22:52.

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