Nginx 0.8.4 Trying to bind on port 80 ?
Jim Ohlstein
nginx-forum at nginx.us
Mon Jun 29 04:21:39 MSD 2009
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:
# 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
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:
# service httpd start
Starting httpd: [ OK ]
# 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)
I then started nginx and it grabbed 8080:
# /usr/local/sbin/nginx
# 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)
I then edited nginx.conf to have nginx listen on 80 and attempted a reload. It failed. Output from error log:
2009/06/28 20:09:54 13787#0: signal process started
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 13779#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2009/06/28 20:09:54 13779#0: still could not bind()
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.
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,3498,3509#msg-3509
More information about the nginx
mailing list