◉◡◉ 您好,欢迎到访伊成个人站!

启动nginx提示Job for nginx.service failed because the control process exited with error code

写在前面

启动nginx的时候,提示异常信息如下:

Job for nginx.service failed because the control process exited with error code.

“伊成博客”

“伊成博客”

查看状态信息,提示配置文件出错:

“server” directive is not allowed here in /etc/nginx/nginx.conf:39

解决方法

发现端口被占用,centos中查看端口被占用命令为

1
netstat -lnp | grep 端口号

杀掉进程: ps -9 进程号

杀掉所有80端口的进程:lsof -i :80|grep -v “PID”|awk ‘{print “kill -9”,$2}’|sh


The end…

支付宝打赏 微信打赏