- 工信部备案号 滇ICP备05000110号-1
- 滇公安备案 滇53010302000111
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
nginx启动服务提示98: Address already in use错误的解决
现象,网站打开都是502,服务器环境是centos+lnmp的环境,先去看看nginx的状态service nginx status,果然看到nginx服务挂了,执行service nginx start启动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()
大概意思就是:端口地址已被使用,但是我们没有其他使用80端口的服务了,很大的可能nginx服务进程卡死了,导致80端口被占用。
解决办法
首先用lsof -i :80查看80端口被什么程序占用,返回结果如下,
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进程占用了80端口,所以我们把nginx进程kill掉,重新启动服务。
命令如下(kill 掉所有的nginx进程):
kill -9 lsof -i :80 |grep nginx |grep -v grep|awk '{print $2}'
service nginx start
Starting nginx... [ OK ]
OK,nginx服务已经成功启动!
售前咨询
售后咨询
备案咨询
二维码
TOP