nginx常用命令

启动:
cd /usr/local/nginx/sbin
./nginx
nginx服务启动后默认的进程号会放在/usr/local/nginx/logs/nginx.pid文件
cat nginx.pid 查看进程号

关闭:
kill -TERM pid  快速停止服务
kill -QUIT pid  平缓停止服务
kill -9 pid     强制停止服务

重启:
cd /usr/local/nginx
./nginx -HUP pid
./nginx -s reload

另外一些常见的命令:
./nginx -h 查看nginx所有的命令参数
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

./nginx -v  显示nginx的版本号
./nginx -V  显示nginx的版本号和编译信息
./nginx -t  检查nginx配置文件的正确性
./nginx -t  检查nginx配置文件的正确定及配置文件的详细配置内容
./nginx -s  向主进程发送信号,如:./nginx -s reload 配置文件变化后重新加载配置文件并重启nginx服务
./nginx -p  设置nginx的安装路径
./nginx -c  设置nginx配置文件的路径

nginx启动、关闭、重启及常用的命令的更多相关文章

  1. nginx启动,重启,关闭命令

    nginx启动,重启,关闭命令 停止操作停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的步骤1:查询nginx主进程号ps -ef | grep nginx在进程列表 ...

  2. Ubuntu下Nginx启动、停止等常用命令

    本文详细介绍Ubuntu下Nginx启动.停止等常用命令.在开发过程中,我们会经常的修改Nginx的配置文件,每次修改配置文件都可以先测试下本次修改的配置文件是否正确,可以利用以下命令: servic ...

  3. [linux] 小问题:管道符,换行问题等;[nginx]启动,重启,关闭命令;以及升级nginx切换命令

    Lniux换行问题 后面回车不会马上执行本条命令而是换行继续. : 是运行完前面就继续后面的, && 同样是前面正确就运行后面, || 是前面运行不正确就运行后面. | 管道符“|”将 ...

  4. nginx 启动、重启、关闭命令

    一.启动 cd /usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径    或者cd /usr/local/ngi ...

  5. nginx 启动、重启、关闭

    一.启动 cd usr/local/nginx/sbin./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径或者使用cd /usr/local/nginx/s ...

  6. nginx启动、重启、关闭

    一.启动 cd usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径 或者使用 cd /usr/local/ngin ...

  7. nginx启动,重启,关闭

    1.nginx启动: a.     /usr/path/sbin/nginx -c [/etc/path/nginx.conf] 中括号中为指定加载的配置文件,不指定则加载默认配置文件 b.     ...

  8. Nginx启动关闭和重启、文档直接下载不阅览

    nginx启动相关 启动:sbin/nginx -c conf/nginx.conf 关闭:sbin/nginx -s stop 重启(重新加载配置文件):sbin/nginx -s reload 检 ...

  9. nginx启动、重启、关闭、升级

    一.启动 cd usr/local/nginx/sbin ./nginx 二.重启 更改配置重启nginx kill -HUP 主进程号或进程号文件路径 或者使用 cd /usr/local/ngin ...

随机推荐

  1. 关于eclipse中的maven插件问题

    最近上课讲eclipse 中的maven插件 有一个坑确实比较坑,实际上就是一个配置的原因. 就是在eclipse中设置java 的buildpath的时候,一般不注意往往都设置成了jre的,这样的话 ...

  2. C# 压缩、解压缩

    /// <summary> /// 压缩文件 FNameArry 为客户端传回来的文件列表:文件名数组,压缩包的名称strZipName /// </summary> /// ...

  3. mybatis配置mapper.xml 的基本操作

    XML 映射文件 本文参考mybatis中文官网进行学习总结:http://www.mybatis.org/mybatis-3/zh/sqlmap-xml.html MyBatis 的真正强大在于它的 ...

  4. ApplicationContextAware 快速获取bean

    在Web应用中,Spring容器通常采用声明式方式配置产生:开发者只要在web.xml中配置一个Listener,该Listener将会负责初始化Spring容器,MVC框架可以直接调用Spring容 ...

  5. php实现字符串翻转,使字符串的单词正序,单词的字符倒序

    如字符串'I love you'变成'I evol uoy',只能使用strlen(),不能使用其他内置函数. function strturn($str){ $pstr=''; $sstr=''; ...

  6. webstorm2018

    1.安装后修改hosts: windows\system32\drivers\etc   管理员权限修改 0.0.0.0 account.jetbrains.com 2. 选择activation c ...

  7. java.net.ProtocolException: Exceeded stated content-length of: '13824' bytes

    转自:https://blog.csdn.net/z69183787/article/details/18967927 1. 原因: 因为weblogic会向response中写东西造成的,解决方式是 ...

  8. 2019-1-25-WPF-ListBox-的选择

    title author date CreateTime categories WPF ListBox 的选择 lindexi 2019-01-25 21:43:17 +0800 2018-2-13 ...

  9. linux处理器子系统调优

  10. MySQL--10 日志简介

    目录 一.MySQL日志简介 二.错误日志 三.一般查询日志 四.二进制日志 五.慢查询日志 一.MySQL日志简介 二.错误日志 作用: 记录mysql数据库的一般状态信息及报错信息,是我们对于数据 ...