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)

上图

这里写图片描述

就是这样,网上也搜了好多办法, 但是一直没效果

先说一下, 我解决的坑,

环境:虚拟机 VMware 14.1.1 Centos 6.4下

如下:
    ps -ef | grep nginx 

    root      24096      1  0 02:16 ?        00:00:00 nginx: master process /usr/local/nginx/sbin/nginx
    nginx     24097  24096  0 02:16 ?        00:00:00 nginx: worker process      
    root      24217  22998  0 02:22 pts/0    00:00:00 grep nginx
    kill -9 nginx
    -bash: kill: nginx: arguments must be process or job IDs

尴尬了, 你会发现,你用kill -9 24097 或者 kill -9 24096 杀不掉!!

解决办法:

    因为我们知道,nginx是80端口,先搜下,80 端口被占用的进程
    lsof -i : 80
    COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
    nginx    2384  root    6u  IPv4  16447      0t0  TCP *:http (LISTEN)
    nginx   22894 nginx    6u  IPv4  16447      0t0  TCP *:http (LISTEN)

现在使用 kill -9 -2384 kill -9 22894 ,就杀掉了进程,

    启动nginx
    /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)