nginx重启失败:Job for nginx.service failed because the control process exited with error code
作者:mmseoamin日期:2024-04-27

前言

因为项目的ssl证书快过期了,所以去重新申请替换了,避免https无法使用。替换证书文件后重启nginx发现报错。

报错提示:

nginx重启失败:Job for nginx.service failed because the control process exited with error code,在这里插入图片描述,第1张

1. 运行status命令查看:

systemctl status nginx

nginx重启失败:Job for nginx.service failed because the control process exited with error code,在这里插入图片描述,第2张

很明显这里是说80端口已被占用,说明有相应的进程在运行,找到进程将其关闭即可!

2. 执行命令:sudo killall -9 nginx将其全部关闭

sudo killall -9 nginx

3. 通过命令:sudo systemctl start nginx启动即可,这是发现nginx服务已经启动成功啦!问题解决!!!nginx重启失败:Job for nginx.service failed because the control process exited with error code,在这里插入图片描述,第3张