1、nginx
启动nginx
service nginx start
查看nginx状态
service nginx status
关闭nginx
service nginx stop
热重启(前提:开启nginx,否则报错:nginx: [error] open() "/var/run/nginx.pid" failed (2: No such file or directory))
nginx -s reload
平滑重启
nginx安装位置
检查配置文件(nginx.conf):
/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
如:
则:配置文件正确
平滑重启命令:kill -HUP `cat /var/run/nginx.pid`
其它命令:
kill -USR2 `cat /var/run/nginx.pid`
kill -QUIT `cat /var/run/nginx.pid.oldbin