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

今天在做LNMP的时候,启动nginx服务,无法开启,导致网页打不开。把服务从起一下发现提示错误如下:

Starting 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服务卡死了,导致端口占用,出现此错误。

解决方法:首先用lsof:80看下80端口被什么程序占用。lsof返回结果如下:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 3274 root 6u IPv4 10664 0t0 TCP *:http (LISTEN)
nginx 3547 nginx 6u IPv4 10664 0t0 TCP *:http (LISTEN)

发现是nginx程序,所以我们把nginx服务k掉,重新启动服务。。命令如下:

kill -9 3274

kill -9 3547

service nginx start

Starting nginx:                                            [  OK  ]

OK了,服务成功启动!~~

时间: 2025-01-10 21:16:54

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 错误解决的相关文章

[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重启时经常遇到的,这个是nginx重复重启导致自己占用了端口.(一般可能是因为自己设置了开机自动启动,或者重复启动) 解决方法 : killall -9 nginx 杀掉nginx 的进程  然后重启(service nginx restart 或 sudo /usr/local/nginx/sbin/nginx) 版权声明

修改nignx报错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的配置时出现,表名80端口被程序占用 列出所有端口: netstat –ntlp 发现端口是被nginx本身占用了,于是关闭占用80端口的程序 sudo fuser -k 80/tcp 之后开启nginx无异常 使用linux一键安装包安装的环境 http://lnmp.org/

Linux教程之: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) 使用命令关闭占用80端口的程序 sudo fuser -k 80/tcp 互联网+时代,时刻要保持学习,携手千锋PHP-PHP培训的实力派,Dream It Possible.

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] socket() [::]:80 failed (97: Address family not supported by protocol) 1 2 定位方法 1.先使用p

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] socket() [::]:80 failed (97: Address family not supported by protocol)定位方法 1.先使用ps -e |

bind() to 0.0.0.0:80 failed (98: Address already in use)

You can kill it using: sudo fuser -k 80/tcp And then try restarting nginx again: service nginx start

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败

Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) nginx 启动失败,日志里面报错信息如下: Starting nginx: nginx: [emerg] bind() to 0.0.0.0:8088 failed (13: Permission denied) 权限拒绝,经检查发现是开启selinux 导致的. 直接关闭 getenforce   这个命令可以查看当前是否开

nginx [emerg] socket() []80 failed (97 Address family not supported by protocol)

1.nginx报错信息 早上通过LNMP部署owncloud 10.0.2的云盘环境,修改nginx配置文件后,重启报错:nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol) 2.分析并解决报错 看到 socket() [::]:80 failed,第一反应就是好像与IPV6有关,Address family not supported by protocol也进一步印证了我的想

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

Mac上启动nginx报如上错误,原因是80端口已被占用,可能有些服务未能成功关闭. 解决:键入命令 sudo nginx -s stop ( 或 sudo nginx -s  quit) ,然后 sudo nginx 重启nginx. 如果是因为其他服务占用了 80端口,如apache服务等,就把对应服务关掉(sudo apachectl stop) .