首页 » 资源分享 » Linux » 正文

关于nginx启动报错:Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.



今天在执行 service nginx restart命令出现下面错误:Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

[vagrant@localhost ~]$ sudo service nginx restart
Redirecting to /bin/systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.

这个错误在重启nginx或者启动nginx的时候经常会出现,具体出错的原因有可能是nginx的配置文件出错,也有可能是端口占用,需要一步步排查错误。

//执行此命令,查看错误原因
[vagrant@localhost ~]$ sudo service nginx status -l