Nginx + uWSGI 使用新安装 Ubuntu - 端口绑定错误 80

我知道这是一个普通的问题,通常与之相关 apache 或者已经在港口工作的其他服务 80, 我正在寻找很多并推出 netstat, 但我仍然不明白为什么我收到这个错误。

我恢复了我的碎片,做了一个新的安装 Ubuntu 10.04 并设置 nginx + uwsgi. 它有效,我能看到我的网站 Django. 然后我安装了 Postgres8.4 以及所需的堆栈所需的其余部分 Geodjango, 的
http://docs.djangoproject.com/ ... stall
.

之后,我试着重新启动 nginx 并收到此错误:

sudo /etc/init.d/nginx start
Starting nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: bind() to 0.0.0.0:80 failed (98: Address already in use)
[emerg]: still could not bind()

我有 nginx 在试镜时定制 80. 这是结果

netstat -l --numeric-ports | grep 80

:

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN

退出

sudo lsof +M -i4

:

nginx    2330     root    8u  IPv4   3195      0t0  TCP *:www (LISTEN)
nginx 2331 www-data 8u IPv4 3195 0t0 TCP *:www (LISTEN)
uwsgi 2335 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN)
uwsgi 2352 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN)
uwsgi 2353 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN)
uwsgi 2354 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN)
uwsgi 2355 s 4u IPv4 3259 0t0 TCP localhost:8000 (LISTEN)

有没有人有其他想法,因为我可以找到港口的块 80?

编辑

插入我的脚本 /etc/init.d/nginx 这里:
http://dpaste.com/hold/400937/
已邀请:

君笑尘

赞同来自:

你不得不发出

restart

作为初始化方案的参数?

我期望

sudo /etc/init.d/nginx start

抱怨,如果 nginx 已经发布了。 似乎是什么。

喜特乐

赞同来自:

netstat -plan

将为您提供过程的名称,然后使用 killall -9

并重启 nginx

裸奔

赞同来自:


fuser -n tcp 80

告诉你 PID 使用港口进行过程 80.

小明明

赞同来自:

我建议您从中插入实际配置文件 / etc / nginx / sites-enabled. 您也可以尝试更清楚地指定您所绑定的IP地址。

我最近面对古怪 nginx (8.54) 和 uWsgi (.96) 在服务器节点上 Ubuntu 10.10 KVM. 我使用了非局部地址的绑定与 VLAN / 捆绑 802.3ad 和桥梁,所以设置从提供者的“片段”理论上是类似的。 我猜认为它与之相关 nginx, 虽然潜在的水平 Ubuntu 也经历了巨大的变化。

我建议尽可能在建立时适用 nginx. 尤其是在一个界面上具有多个IP地址或IP地址的介质中。

http://linux-ip.net/html/adv-nonlocal-bind.html

要回复问题请先登录注册