Welcome! Log In Create A New Profile

Advanced

Re: Nginx 0.8.4 Trying to bind on port 80 ?

June 28, 2009 08:21PM
olefebvre Wrote:
-------------------------------------------------------
> No !!! As i wrote on the first page the setup is
> as follow:
> IPTABLES roots external access to port 80 to port
> 8080 which is NGinx Listening Port.
> From then on either NGinx serves all the pages or
> proxy them to Apache depending on which Vhost is
> considered. So it's really Nginx proxying to
> Apache not the other way round. With this setup i
> can simply remove Nginx by just erasing the
> IPTABLES rule.
>
>
> This setup has not been changed for months, and it
> works for every Nginx iteration up to 0.8.3, but
> fail with bind error on the 0.8.4 release.

Are you certain that your nginx.conf has not been overwritten or the path changed with your latest configuration?

On a Linux test server I set Apache to listen on 80. I compiled nginx-0.8.4 from source with the following very basic configure command:

[code]
[root@atom conf]# nginx -V
nginx version: nginx/0.8.4
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-44)
configure arguments: --pid-path=/usr/local/nginx/logs/nginx.pid --sbin-path=/usr/local/sbin/nginx --with-http_stub_status_module --user=nginx --group=nginx
[/code]

I used the default nginx.conf with the exception that I changed the "listen" directive from

listen 80;

to

listen 8080;

I started Apache and it grabbed 80:

[code]
[root@atom conf]# service httpd start
Starting httpd: [ OK ]
[root@atom conf]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 13767 root 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13769 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13770 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13771 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13772 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13773 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13774 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13775 apache 4u IPv6 84950 TCP *:http (LISTEN)
httpd 13776 apache 4u IPv6 84950 TCP *:http (LISTEN)
[/code]

I then started nginx and it grabbed 8080:
[code]
[root@atom conf]# /usr/local/sbin/nginx
[root@atom conf]# lsof -i tcp:8080
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
nginx 13779 root 6u IPv4 85204 TCP *:webcache (LISTEN)
nginx 13780 nginx 6u IPv4 85204 TCP *:webcache (LISTEN)
[/code]

I then edited nginx.conf to have nginx listen on 80 and attempted a reload. It failed. Output from error log:
[code]
2009/06/28 20:09:54 [notice] 13787#0: signal process started
2009/06/28 20:09:54 [emerg] 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 [emerg] 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 [emerg] 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 [emerg] 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 [emerg] 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 [emerg] 13779#0: still could not bind()
[/code]

The most logical conclusion is that with your latest compile the path to nginx.conf was changed or nginx.conf was overwritten.

Please post the output of

# nginx -V

(for both nginx-0.8.3 and nginx-0.8.4)

and the contents of nginx.conf file that is specified by each.

--
Jim Ohlstein
Subject Author Posted

Nginx 0.8.4 Trying to bind on port 80 ?

olefebvre June 28, 2009 06:44AM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

mike June 28, 2009 06:57AM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

olefebvre June 28, 2009 10:56AM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

mike June 28, 2009 01:38PM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

olefebvre June 28, 2009 04:49PM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

mike June 28, 2009 05:53PM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

Jim Ohlstein June 28, 2009 08:21PM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

olefebvre June 29, 2009 02:47AM

Re: Nginx 0.8.4 Trying to bind on port 80 ?

plop March 04, 2013 06:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready