找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 查看内容

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

作者:模板之家 2020-12-5 13:16 83人关注

nginx教程:本文为大家分享了解决使用systemctl命令启动nginx报错问题的方法,具有一定的参考价值,希望能够帮助到大家。

问题:

使用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

以上就是使用systemctl命令启动nginx竟然报错了?什么原因?的详细内容,更多请关注模板之家(www.mb5.com.cn)其它相关文章!


路过

雷人

握手

鲜花

鸡蛋
来自: 网络收集

全部回复(0)