本文参考: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即可,我重新启动了虚拟机)

本文详细介绍了在遇到Nginx服务启动失败时的解决步骤,包括如何通过查看系统日志定位问题,发现端口冲突,并给出了具体的命令来释放被占用的端口,最终成功重启Nginx服务。
8万+

被折叠的 条评论
为什么被折叠?



