【问题标题】:Nginx restart command failing after installing passenger安装乘客后 Nginx 重启命令失败
【发布时间】:2011-06-18 03:32:57
【问题描述】:

我刚刚在我的 Ubuntu (8.04) 机器上为 nginx 安装了乘客。现在“sudo /etc/init.d/nginx restart”失败并出现以下错误:

Restarting nginx: [emerg]: bind() to 0.0.0.0:3000 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:3000 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:3000 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:3000 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:3000 failed (98: Address already in use)
[emerg]: still could not bind()
nginx.

我在安装乘客后更新了 ..init.d/nginx 配置以指向 /opt/nginx,所以应该没问题。

如果我使用“sudo killall nginx”终止进程并尝试启动 nginx,它可以正常工作,但重新启动不起作用。

【问题讨论】:

  • 似乎其他服务正在使用端口 3000。您可以执行“ps auxwww|grep LISTEN|grep 3000”来查看正在使用该端口的进程。

标签: nginx passenger ubuntu-8.04


【解决方案1】:

在我的例子中,apache 已经安装并且正在使用该端口;所以我就这么做了:

killall -9 apache2

也许你的情况是另一个软件,你可以使用这个命令来检查哪些端口正在监听请求

netstat -a | egrep 'Proto|LISTEN'

【讨论】:

    【解决方案2】:

    忽略

    nginx: [warn] conflicting server name "69.162.95.11" on 69.162.95.11:80, ignored
    

    这不是错误,只是警告 69.162.95.11 不是共享 IP 关于

    nginx: [emerg] bind() to 69.162.95.14:80 failed (98: Address already in use) 
    

    重启 Nginx 会解决这个问题,如果没有然后检查调整设置下的无 ssl 端口。安装后无 ssl 端口应为 8081。 大师 2011 年 2 月 12 日,上午 1 点 42 分 从 apache 或 ltespeed 关闭端口 80 并开启 nginxcp 为 80 端口

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-01-14
      • 1970-01-01
      • 1970-01-01
      • 2012-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多