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

一通操作下来,重启nginx的时候报错,再重启系统后,nginx直接不启动了,使用start时同样报错。

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

看这意思大概时端口被占用了。

查看端口

netstat -anp |grep 80

显示有两个进程使用了80端口,且都是nginx。

结束进程

kill 5139

直接结束进程,再次启动nginx:

nginx -s start

发表于:2019-11-17