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.1Centos 6.4下如下:ps -ef | grep nginxroot2...
·
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
启动成功! 至此,问题完美解决。
更多推荐
已为社区贡献1条内容
所有评论(0)