Nginx
Nginx的启动、重启、停止
切换至Nginx安装目录下的sbin文件夹 cd /usr/local/nginx/sbin
启动代码格式:nginx安装目录地址 -c nginx配置文件地址
[root@LinuxServer sbin]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
停止
1、查看进程号 ps -ef|grep nginx
2、杀死进程 kill -QUIT 2072
快速停止
1、查看进程号 ps -ef|grep nginx
2、杀死进程 kill -INT 2132
kill -TERM 2132
强制停止 pkill -9 nginx
重启
1、验证nginx配置文件是否正确
方法一:进入nginx安装目录sbin下,输入命令./nginx -t
看到显示nginx.conf syntax is ok
nginx.conf test is successful
方法二:在启动命令-c前加-t
/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf
2、重启Nginx服务
浙公网安备 33010602011771号