nginx:Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' fo

版权声明:@抛物线 https://blog.csdn.net/qq_28513801/article/details/88980125

1、按照提示

//按照提示,执行此命令,查看错误原因
systemctl status nginx.service

由报错信息可知,nginx绑定80端口失败。详细错误请输入 -l 继续查看

2、继续跟踪错误

//查看错误的详情
systemctl status nginx.service -l
这里输入 -l 之后,说实话,差距并不大。原因还是绑定端口失败。

三、解决方案
1、查看此时占用80端口的程序

netstat -ntlp | grep 80

这里可以看到,80端口是被占用的 。我们再详细看看占用80的是什么

ps -ef | grep 80
然后找到pid,杀掉这些程序

//-s 9 代表的是快速强制的杀掉pid程序
kill -s 9 pid
2、杀到没有程序可杀为止,然后启动nginx

此时启动成功。

猜你喜欢

转载自blog.csdn.net/qq_28513801/article/details/88980125