nginx无法绑定到80端口。没有任何端口80上运行

我试图在Ubuntu 11.04上安装nginx。 我大致遵循这里find的方向: http : //library.linode.com/frameworks/sinatra/debian-6-squeeze 。 我知道这是Debian,但我基本上采取了这些步骤,然后Googlesearch“在Ubuntu 11.04如何做x”虽然,我从他们的图书馆拉的init脚本。

Starting nginx: 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() 

命令:'sudo lsof -i:80'在端口80上不返回任何内容。

如何解决这个或任何想法可能出错?

我看到一个新的Ubuntu安装Nginx + uWSGI – 绑定错误端口80,并尝试重新启动计算机并运行一次,我得到相同的错误。 运行一次之后,我运行了lsof命令。

UPDATE

sudo netstat -ltnp返回:

  Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1998/sshd tcp6 0 0 :::22 :::* LISTEN 1998/sshd 

nestat -a回报:

 Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:ssh *:* LISTEN tcp 0 176 matterhorn.noahc.ne:ssh 173-26-190-206.cl:26467 ESTABLISHED tcp6 0 0 [::]:ssh [::]:* LISTEN udp 0 0 matterhorn.noahc.:35332 10504.x.rootbsd.net:ntp ESTABLISHED udp 0 0 matterhorn.noahc.:53298 tick.tadatv.com:ntp ESTABLISHED udp 0 0 matterhorn.noahc.:54371 ns1.baribault.net:ntp ESTABLISHED udp 0 0 matterhorn.noahc.:38304 tardis.chpc.utah.ed:ntp ESTABLISHED Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 684 @/com/ubuntu/upstart unix 2 [ ] DGRAM 730 @/org/kernel/udev/udevd unix 6 [ ] DGRAM 4316 /dev/log unix 2 [ ] DGRAM 11447 unix 3 [ ] STREAM CONNECTED 10466 unix 3 [ ] STREAM CONNECTED 10465 unix 2 [ ] DGRAM 11411 unix 3 [ ] STREAM CONNECTED 2958 unix 3 [ ] STREAM CONNECTED 2957 unix 2 [ ] DGRAM 4518 unix 2 [ ] DGRAM 2902 unix 2 [ ] DGRAM 2614 unix 3 [ ] STREAM CONNECTED 1284 @/com/ubuntu/upstart unix 3 [ ] STREAM CONNECTED 4131 unix 3 [ ] DGRAM 733 unix 3 [ ] DGRAM 732 unix 3 [ ] STREAM CONNECTED 1038 @/com/ubuntu/upstart unix 3 [ ] STREAM CONNECTED 2088 

一种可能性是,由于某种原因,nginx绑定到端口80两次。

如果它试图做到这一点将失败。 一个例子可能是绑定到IPV6和IPV4,或绑定到公共IP和通配符IP。

检查你的nginxconfiguration,确保它只绑定一次。

尝试:

 http{ server { listen 80; listen localhost; # <- probably will fix your problem location / { root /data/www; } location /images/ { root /data; } } }