nginx提示地址或端口被占用解决

今天在启动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()

nginx也没有启动进程

[root@iZ25dgob05vZ /]# ps -ef|grep nginx

root     12150 12079  0 10:20 pts/0    00:00:00 grep nginx

kill也不能停掉进程

[root@iZ25dgob05vZ /]# killall -9 nginx

nginx: 没有进程被杀死

找了N多答案,都是说是端口被占用,但是各种解决方法无效可尝试以下操作:

1、检查80端口被什么程序占用

命令:fuser -n tcp 80

[root@iZ25dgob05vZ /]# fuser -n tcp 80

80/tcp:               7588

删除对应端口

[root@iZ25dgob05vZ /]# kill -9 7588

重新启动nginx

[root@iZ25dgob05vZ /]#  service nginx restart

Stopping nginx:                                         [FAILED]

Starting nginx:                                            [  OK  ]

发表评论