zoukankan      html  css  js  c++  java
  • nginx命令使用

     NGINX帮助 -h

    [19:08:40 root@localhost sbin]#nginx -h
    nginx version: nginx/1.16.1
    Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
    
    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: /apps/nginx/)
      -c filename   : set configuration file (default: conf/nginx.conf)
      -g directives : set global directives out of configuration file

      一、开启nginx服务

        1、使用nginx自带的命令

    nginx

        2、使用systemctl命令

    systemctl start nginx

      二、nginx帮助命令

    nginx -?

    nginx -h

      三、显示nginx的版本号,然后退出

    nginx -v

      四、显示版本和安装时配置选项,然后退出

    nginx -V

      五、测试配置,然后退出

    nginx -t

      六、测试配置,转储然后退出

    nginx -T

      七、关闭nginx服务

    nginx -s stop

      八、重读nginx配置文件

    nginx -s reload

      九、设置前缀路径(默认值:/apps/nginx/)

    nginx -p

      十、设置配置文件(默认为conf/nginx.conf),指定配置文件

    nginx -c /data/nginx.conf

      十一、从配置文件中设置全局指令

    nginx -g 指令

      十二、开机自启动nginx服务

      1、使用systemctl 命令

    systemctl enable nginx

      2、编译安装没有systemctl 命令,使用centos7自带的开机自启文件

        1)、修改centos7自带的开机自启动文件中

    vim  /etc/rc.d/rc.local

        2)、添加NGINX的路径

    /usr/sbin/nginx

        3)、这个文件默认没有执行权限,添加执行权限

    chmod +x /etc/rc.d/rc.local
    ------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------- 博客均为个人笔记,无所追求,仅供参考~~~ QQ--2382990774
  • 相关阅读:
    python:dataclass装饰器详
    python : tuple 相加,注意逗号
    python itertools chain()
    Python classmethod 修饰符
    ILMerge
    a标签点击后页面显示个false
    Visual Studio自动生成XML类和JSON类
    元组简单示例
    jQuery插件示例笔记
    jQuery中的Ajax全局事件
  • 原文地址:https://www.cnblogs.com/alexlv/p/14819389.html
Copyright © 2011-2022 走看看