排错集锦2 nginx安装开启失败

Posted 遙遙背影暖暖流星

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了排错集锦2 nginx安装开启失败相关的知识,希望对你有一定的参考价值。

问题:对安装对启动路径进行了优化,现在可以利用systemctl进行管理,但发现启动不了

在这里插入图片描述
如图

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()

解决方法:
lsof -i:80 #查看80端口被哪些进程占用,可以看到是httpd
在这里插入图片描述
重新启动,依旧失败
在这里插入图片描述

lsof -i:80却这是占用进程改变,再杀,并把httpd 关闭且不自动开启
systemctl stop httpd ,systemctl disable httpd

再开启,成功

以上是关于排错集锦2 nginx安装开启失败的主要内容,如果未能解决你的问题,请参考以下文章