我尝试运行“nginx -c /etc/nginx/nginx.conf”,但得到:
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()
[Exit 1]
然后我运行
fuser -k 80/tcp ; service nginx restart.
我再次尝试使用“nginx -c /etc/nginx/nginx.conf”,但仍然出现相同的错误“[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)”
为什么会发生这种情况?
答案1
这不是你重新加载 nginx 的方法。
你正在尝试的是启动 nginx再次,-c
仅指定应使用的配置文件。
使用service nginx reload
或/etc/init.d/nginx reload
重新加载它。