1,启动 nginx报错
systemctl start nginx
[root@laoban yum.repos.d]# systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "jetails.
[root@laoban yum.repos.d]#
2,查看nginx状态
systemctl status nginx.service
报错提示: Failed to start The nginx HTTP and reverse proxy server.
3,看一下nginx端口号
netstat -anpt | grep nginx
nginx端口号是71816
4,杀死nginx进程
kill -QUIT 主进程号
kill -QUIT 71816
经过测试,kill -QUIT
该命令会自动 kill 掉 nginx 的父和子进程,推荐使用!如果 只用 kill -9 主进程
,只有主进程被 kill,nginx 子进程还在!!!
5,重启
systemctl restart nginx
systemctl status nginx