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

Posted 又见江南

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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] socket() [::]:80 failed (97: Address family not supported by protocol)
定位方法

1.先使用ps -e | grep nginx查看是否已经启动了nginx

2.如果没有的话则按照提示,查看0.0.0.0:80端口谁占用了,使用netstat -ltunp命令,可以看到

可以看到0.0.0.0:80端口被httpd这个进程占用了(也就是apcache占用)

关闭httpd服务即可

以上是关于nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)解决的主要内容,如果未能解决你的问题,请参考以下文章

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败

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

Gitlab 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

nginx - nginx:[emerg] bind()到[::]:80失败(98:地址已经在使用中)

nginx: [emerg] bind() to 0.0.0.0:18071 failed (13: Permission denied)