本文参考:https://www.cnblogs.com/hhyf/p/11518919.html
启动nginx失败:
Job for nginx.servicefailedbecause the control process exited with error code.See “systemctl status nginx.service” and “journalctl -xe” for details.
懂得查看日志很重要!
安装完成后使用
systemctl start nignx
出现
Job for nginx.servicefailedbecause the control process exited with error code.See “systemctl status nginx.service” and “journalctl -xe” for details.
再查看nginx状态
systemctl status nginx.service
address alreadly in use 说明端口被占用
查看被什么占用
命令: netstat -apn|grep :80
可以看到977/httpd 占用了端口,需要将服务关闭
命令:service httpd stop
然后再重启nginx就可以启动
(应该直接重新启动nginx即可,我重新启动了虚拟机)