zoukankan      html  css  js  c++  java
  • nginx启动、关闭、重启及常用的命令

    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配置文件的路径

  • 相关阅读:
    关于JVM的一些想法
    hashMap理解以及jdk1.7、jdk1.8其中区别
    各数据库如何实现自增
    dubbo遇坑记录
    mysql建表语句问题
    @Configuration
    生成一个唯一的ID
    门面模式
    关于getClass().getClassLoader()
    元素链
  • 原文地址:https://www.cnblogs.com/yhtboke/p/10404792.html
Copyright © 2011-2022 走看看