nginx重启时遇到open() "/usr/local/nginx/sbin/ngnix.pid" failed

今天安装配置完nginx时,重启时遇到如下问题

[root@hwtest-hk sbin]# ./nginx -s stop
nginx: [error] open() "/usr/local/nginx/sbin/ngnix.pid" failed (2: No such file or directory)
解决上面的办法是重新加载一下ngnix的配置命令如下
[root@hwtest-hk sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
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端口被占用问题

[root@hwtest-hk sbin]#  sudo fuser -k 80/tcp
80/tcp:               7521  7522  7523  7524  7525  7526  7527  7528  7529  7530  7531  7532  7533  7534  7535  7536  7537

并重新再次加载nginx配置文件

[root@hwtest-hk sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
再次校验nginx

[root@hwtest-hk sbin]# ./nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@yolotone-hk sbin]# ./nginx 
启动完成,done!



  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值