跳转至
-->

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

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

1
2
3
4
5
6
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()
看这意思大概时端口被占用了。

查看端口

1
netstat -anp |grep 80
显示有两个进程使用了80端口,且都是nginx。

结束进程

1
kill 5139
直接结束进程,再次启动nginx:
1
nginx -s start