您的位置:首页 > 运维架构 > Nginx

linux环境停止和启动nginx

2015-09-21 17:18 686 查看

步骤1:查询nginx主进程号

ps -ef | grep nginx

在进程列表里 面找master进程,它的编号就是主进程号了。

步骤2:停止nginx

从容停止Nginx:

kill -QUIT 主进程号

快速停止Nginx:

kill -TERM 主进程号

强制停止Nginx:

pkill -9 nginx

步骤3:启动nginx

环境1:

[root@iZ25yepqfvvZ /]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

[root@iZ25yepqfvvZ /]# ps -ef | grep nginx

root 18798 1 0 16:35 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

root 18799 18798 0 16:35 ? 00:00:00 nginx: worker process

root 18800 18798 0 16:35 ? 00:00:00 nginx: worker process

root 18801 18798 0 16:35 ? 00:00:00 nginx: worker process

root 18802 18798 0 16:35 ? 00:00:00 nginx: worker process

root 18827 15138 0 16:36 pts/1 00:00:00 grep nginx

环境2

[root@iZ25yepqfvvZ /]# /usr/sbin/nginx -c /etc/nginx/nginx.conf

[root@iZ25knm9r1gZ ~]# ps -ef | grep nginx

root 28969 1 0 16:50 ? 00:00:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

nginx 28970 28969 0 16:50 ? 00:00:00 nginx: worker process

nginx 28971 28969 0 16:50 ? 00:00:00 nginx: worker process

nginx 28972 28969 0 16:50 ? 00:00:00 nginx: worker process

nginx 28974 28969 0 16:50 ? 00:00:00 nginx: worker process

root 29419 29401 0 17:11 pts/0 00:00:00 grep nginx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: