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
相关文章推荐
- nginx+rtmp实现视频直播
- 关于使用NGINX PIUS配置负载均衡
- RHEL5.8搭建LNMP平台实例
- (总结)Nginx配置文件nginx.conf中文详解
- centos下安装nginx
- Nginx 虚拟主机 VirtualHost 配置
- Nginx + fail2ban 提高安全性
- 大型架构.net平台篇(WEB层均衡负载nginx)
- Ubuntu中Nginx的安装与配置
- PHP+Nginx环境搭配
- Linux下的nginx启动、重新启动
- Nginx Location配置总结
- HAProxy+Nginx 负载均衡
- 解析nginx负载均衡
- 简单配置nginx
- nginx防止部分DDOS攻击
- nginx负载均衡高级策略-upstream
- resin+nginx搭建高性能Java服务器
- 使用Nginx+Lua搭建AB测试平台
- nginx笔记, 安装,配置,集群