启动nginx服务时出错,提示nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
来源:互联网 发布:米桶什么牌子好 知乎 编辑:程序博客网 时间:2024/06/01 08:25
昨天做好的Lnmp架构,今天启动不了nginx服务,提示信息如下:
[root@wulinux ~]# service nginx start
正在启动 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命令查看端口状态,然后kill掉服务。
如果电脑上不识别lsof命令,要yum下。命令如下:
yun install -y lsof
然后查看端口状态,我nginx服务用的是80端口。
lsof -i :80 # -i 用以显示符合条件的进程情况
显示:
[root@wulinux ~]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 1173 root 6u IPv4 9374 0t0 TCP *:http (LISTEN)
nginx 1174 nobody 6u IPv4 9374 0t0 TCP *:http (LISTEN)
用kill杀掉进程, -9参数为强行中止
[root@wulinux ~]# kill -9 1173
[root@wulinux ~]# kill -9 1174
然后重启nginx服务
[root@wulinux ~]# service nginx start
正在启动 Nginx: [确定]
成功了,网页可以访问了。
后来发现一个问题,其实不像apache一样,每次开机都要重启服务(我的是这样的)。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错误之 nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- 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] 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] 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)
- Mac上启动nginx报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
- C++学习
- Linux下的tty终端修改显示中文乱码
- Android基础核心内容
- Android性能测试的环境搭建
- Error LNK2019 unresolved external symbol __vsnprintf … (in dxerr.lib)
- 启动nginx服务时出错,提示nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- [已解决] 进不了onreadystatechange 状态一直是1
- 第一天上安卓
- PDO连接数据库
- 区间和问题
- 如何切换fragement,不重新实例化
- CentOS 时间设置 时区设置
- 浅谈一下我所看到的独立游戏存在的问题---文/疯王子
- Ajax的使用