nginx 启动报错:Failed to start The nginx HTTP and reverse proxy server.

1,194 阅读1分钟

nginx 启动报错:Failed to start The nginx HTTP and reverse proxy server.

  1. 查看端口和进程
    找到 nginx work id
    netstat -anpt

  2. kill -QUIT 主进程号
    经过测试,该命令会自动 kill 掉 nginx 的父和子进程。推荐使用! 只用 kill -9 主进程,只有主进程被 kill,nginx 子进程还在!!!

  3. 重启 nginx
    systemctl restart nginx

  4. 查看状态
    systemctl status nginx

关闭防火墙

1、命令行界面输入命令“systemctl status firewalld.service”并按下回车键。

2、然后在下方可度以查看得到“active(running)”,此时说明防火墙已经被打开了。

3、在命令行中输入systemctl stop firewalld.service命令,进行关闭防火墙。

4、然后再使用命令systemctl status firewalld.service,在下方出现disavtive(dead),这就说明防火墙已经关闭。

5、再在命令行中输入命令“systemctl disable firewalld.service”命令,即可永久关闭防火墙。