检查Nginx状态提示Job for nginx.service failed because the control process exited with error code

搬瓦工机场JMS

前天在正常给一台服务器重新安装LNMP环境的时候,且在最后可以看到成功界面。于是就正常的重新部署站点环境添加站点转移数据,且解析也确定没有问题,可是网站还是打不开,我开始以为是域名我本地没有解析成功,让其他同事帮忙打开依旧是无法打开的。可以判断出来当前服务器配置环境出现故障。

于是检查Nginx状态重启发现有故障:

Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

然后再检查Nginx的状态:

>>> systemctl status nginx.service
● nginx.service – nginx – high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2019-08-13 07:17:32 CST; 32s ago
Docs: http://nginx.org/en/docs/ From itbulu.com
Process: 21862 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)

Feb 06 09:10:22 10-46-88-14 systemd[1]: Starting nginx – high performance web server…
Feb 06 09:10:22 10-46-88-14 nginx[21862]: nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:35
Feb 06 09:10:22 10-46-88-14 systemd[1]: nginx.service: control process exited, code=exited status=1
Feb 06 09:10:22 10-46-88-14 systemd[1]: Failed to start nginx – high performance web server.
Feb 06 09:10:22 10-46-88-14 systemd[1]: Unit nginx.service entered failed state.
Feb 06 09:10:22 10-46-88-14 systemd[1]: nginx.service failed.

可以判断出来端口应该是被占用还是配置conf文件有错误,理应不应该的,因为是直接自动化安装的,手工安装可能会文件配置错误,自动不可能问题。且检查80端口也没有被占用,在解决问题的时候又发现mysql又无法连接。

最后感觉实在太麻烦,直接重新格式化系统,重新安装一遍,居然没有问题。可能在部署WEB系统的时候中间有出现意外导致的,与其这样找问题,反正服务器里没有数据,那还是直接重新格式化来一遍简单。

未经允许不得转载:搬瓦工VPS_美国VPS » 检查Nginx状态提示Job for nginx.service failed because the control process exited with error code

赞 (0) 打赏

相关推荐

    暂无内容!

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏