我试图运行“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)”
为什么会这样?
这不是你重新加载 nginx 的方式。
你正在尝试再次启动 nginx ,
-c
只是指定它应该使用的配置文件。使用
service nginx reload
或/etc/init.d/nginx reload
重新加载它。