Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【20160923】nginx启动,重启,关闭命令 #18

Closed
zhongxia245 opened this issue Sep 23, 2016 · 0 comments
Closed

【20160923】nginx启动,重启,关闭命令 #18

zhongxia245 opened this issue Sep 23, 2016 · 0 comments
Labels

Comments

@zhongxia245
Copy link
Owner

nginx启动,重启,关闭命令

时间:2016-09-23 16:52:22

启动

nginx -c nginx配置文件地址   

停止

ps -ef | grep nginx

//从容停止Nginx:
kill -QUIT 主进程号

//快速停止Nginx:
kill -TERM 主进程号

//强制停止Nginx:
pkill -9 nginx

eg:

nginx 命令, 使用默认的配置,启动 nginx

重启

nginx -s reload

修改了nginx的配置文件, 需要重启下 nginx服务。

平滑重启

如果更改了配置就要重启Nginx,要先关闭Nginx再打开?不是的,可以向Nginx 发送信号,平滑重启。 平滑重启命令:kill -HUP 主进称号或进程号文件路径 或者使用/usr/nginx/sbin/nginx -s reload

注意:修改了配置文件后最好先检查一下修改过的配置文件是否正 确,以免重启后Nginx出现错误影响服务器稳定运行。判断Nginx配置是否正确命令如下:

//检查指定的nginx配置文件,是否正确
nginx -t -c /usr/nginx/conf/nginx.conf  

//检查默认的nginx配置文件
/usr/nginx/sbin/nginx -t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant