nginx启动、停止、重启命令,nginx停止重启命令
nginx启动、停止、重启命令,nginx停止重启命令
Windows要先进入nginx的目录(博主不知道Windows怎么直接输入路径启动,有知道的大神也麻烦留言告诉我吧,谢谢~~!),linux可以直接路径+执行 如 启动 Nginx Windows:cd /usr/nginx/
nginx
linux:
/usr/nginx/nginx
linux:
查询nginx主进程号
ps -ef | grep nginx
在进程列表里面找master进程,它的编号就是主进程号了。
步骤2:发送信号
从容停止Nginx:
kill -QUIT 主进程号
快速停止Nginx:
kill -TERM 主进程号
强制停止Nginx:
pkill -9 nginx
Windows: 查看windows任务管理器下Nginx的进程命令: tasklist /fi "imagename eq nginx.exe"
重启(重新加载配置) nginx -s reload
停止 Nginx
快速停止或关闭Nginx:nginx -s stop
正常停止或关闭Nginx:nginx -s quit
修改了配置文件后最好先检查一下修改过的配置文件是否正确,以免重启后Nginx出现错误影响服务器稳定运行。 判断Nginx配置是否正确命令如下:
检查配置文件是否正确
/usr/nginx -t指定配置文件
nginx -c /usr/nginx/conf/nginx.conf
检查指定配置文件
nginx -t -c /usr/nginx/conf/nginx.conf
查看 Nginx 的版本信息的参数
nginx -v
详细的版本信息
nginx -V
显示帮助信息 nginx -h
附: Options:
-?,-h : this help
-v : show version and exit
-V : show version and configure options then exit
-t : test configuration and exit
-q : suppress non-error messages during configuration testing -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
评论暂时关闭