https://www.cnblogs.com/codingcloud/p/5095066.htmlhtml
启动
启动代码格式:nginx安装目录地址 -c nginx配置文件地址nginx
例如:spa
[root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
中止
nginx的中止有三种方式:3d
-
从容中止
一、查看进程号code
[root@LinuxServer ~]# ps -ef|grep nginx
二、杀死进程htm
[root@LinuxServer ~]# kill -QUIT 2072
-
快速中止
一、查看进程号blog
[root@LinuxServer ~]# ps -ef|grep nginx
二、杀死进程进程
[root@LinuxServer ~]# kill -TERM 2132
或 [root@LinuxServer ~]# kill -INT 2132
-
强制中止
[root@LinuxServer ~]# pkill -9 nginx
重启
一、验证nginx配置文件是否正确
方法一:进入nginx安装目录sbin下,输入命令./nginx -t
看到以下显示nginx.conf syntax is okclass
nginx.conf test is successfultest
说明配置文件正确!