nginx常用命令
2016-04-07 00:00
441 查看
摘要: 权当快速查阅了。
-1、官方文档
http://nginx.org/en/docs/switches.html
0、查看官方提醒
1、启动nginx
2、检查nginx配置是否合法
3、关闭或停止nginx
4、使用kill关闭或停止nginx
5、重新加载nginx配置文件
6、指定nginx配置文件
7、查看nginx版本
-1、官方文档
http://nginx.org/en/docs/switches.html
0、查看官方提醒
./sbin/nginx -h 结果如下 Options: -?,-h : this help -v : show version and exit -V : show version and configure options then exit -t : test configuration and exit -T : test configuration, dump it 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
1、启动nginx
./sbin/nginx
2、检查nginx配置是否合法
./sbin/nginx -t #需要详情 ./sbin/nginx -t -c [配置文件地址]
3、关闭或停止nginx
./sbin/nginx -s stop ./sbin/nginx -s quit
4、使用kill关闭或停止nginx
停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的 步骤1:查询nginx主进程号 ps -ef | grep nginx 在进程列表里 面找master进程,它的编号就是主进程号了。 步骤2:发送信号 从容停止Nginx:(请求处理完再关闭) kill -QUIT 主进程号 快速停止Nginx: kill -TERM 主进程号 强制停止Nginx: kill -9 nginx
5、重新加载nginx配置文件
./sbin/nginx -s reload 从容更新配置文件 kill -HUP pid
6、指定nginx配置文件
./sbin/nginx -c /usr/local/nginx/conf/nginx.conf
7、查看nginx版本
./sbin/nginx -v
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- Nginx 学习笔记(一)
- 网站502与504错误分析
- 用zabbix监控nginx_status状态
- 艰难完成 nginx + puma 部署 rails 4的详细记录
- 把Lua编译进nginx步骤方法
- web 应用中常用的各种 cache详解
- Linux系统上配置Nginx+Ruby on Rails+MySQL超攻略
- window+nginx+php环境配置 附配置搭配说明
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- 将PHP从5.3.28升级到5.3.29时Nginx出现502错误
- 基于Nginx0.8.54+PHP5.3.4+MySQL5.5.8的全新LNMP稳定版架构搭建的VPS