• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

使用systemctl命令启动nginx竟然报错了什么原因

武飞扬头像
PHP中文网
帮助151

问题:

使用systemctl start nginx命令启动nginx发现报错了,报错内容如下:

Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.[object Object]

问题分析:

nginx -t 检查没有问题

systemctl status nginx 查看nginx状态,显示报错为 80端口被占用

Jul 13 16:18:18 web01 nginx[2407]:nginx:[emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

原因分析:

安装时 启动使用了 nginx命令启动,修改配置文件之后又使用 systemctl restart nginx命令启动

nginx命令启动时已将80端口占用,再使用systemctl restart nginx 又是跑到端口80 导致冲突报错

解决方法:

查看nginx端口状态

ps -ef|grep nginx #查看nginx端口使用情况

将nginx进程ss

pkill nginx

再使用system方式启动

systemctl start nginx

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanffheb
系列文章
更多 icon
同类精品
更多 icon
继续加载