一句简单命令重启nginx
程序员文章站
2023-11-18 22:53:16
但研究了一下nginx帮助后发现,有-s参数可对nginx服务进行管理: # /usr/local/nginx/sbin/nginx -h nginx version: n...
但研究了一下nginx帮助后发现,有-s参数可对nginx服务进行管理:
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
usage: nginx [-?hvvt] [-s signal] [-c filename] [-p prefix] [-g directives]
options:
-?,-h : this help
-v : show version and exit
-v : show version and configure options then exit
-t : test configuration and exit
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
于是我执行
# /usr/local/nginx/sbin/nginx -s reload
nginx已经重启成功
用root权限
#killall nginx
#nginx
其它相关命令:
1.显示nginx进行id
#ps -aux | grep nginx
2.结果nginx的master进行pid
#kill -hup 635
3.重启ngnix
#nginx
# /usr/local/nginx/sbin/nginx -h
nginx version: nginx/0.7.63
usage: nginx [-?hvvt] [-s signal] [-c filename] [-p prefix] [-g directives]
options:
-?,-h : this help
-v : show version and exit
-v : show version and configure options then exit
-t : test configuration and exit
-s signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
于是我执行
# /usr/local/nginx/sbin/nginx -s reload
nginx已经重启成功
用root权限
#killall nginx
#nginx
其它相关命令:
1.显示nginx进行id
#ps -aux | grep nginx
2.结果nginx的master进行pid
#kill -hup 635
3.重启ngnix
#nginx
上一篇: Nginx 启动脚本/重启脚本代码
下一篇: PHP 面向对象实现代码