启动nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

现象:

[root@server1 nginx-1.17.4]# /usr/local/nginx/sbin/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 (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()

原因:

    查看报错原因:说是80端口已经被使用

解决方法:

     关闭80端口

[root@server1 nginx-1.17.4]# fuser -k 80/tcp
80/tcp:               2145  2146  2147  2148  2149  2150

然后启动nginx启动成功~~~~

发布了148 篇原创文章 · 获赞 18 · 访问量 4494

猜你喜欢

转载自blog.csdn.net/weixin_42221657/article/details/104062434