zoukankan      html  css  js  c++  java
  • 【nginx】常用命令 启动|停止|重启|重新读取配置-centOS7

     查看服务的当前状态

    (flaskApi) [root@67 goTest]# systemctl status nginx.service
    ● nginx.service - The nginx HTTP and reverse proxy server
       Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
       Active: active (running) since 一 2019-10-21 13:52:34 CST; 3min 56s ago
     Main PID: 25799 (nginx)
       CGroup: /system.slice/nginx.service
               ├─25799 nginx: master process /usr/sbin/nginx
               ├─25800 nginx: worker process
               ├─25801 nginx: worker process
               ├─25802 nginx: worker process
               └─25803 nginx: worker process
    
    10月 21 13:52:34 67.59.247.60.static.bjtelecom.net systemd[1]: Starting The nginx HTTP and r....
    10月 21 13:52:34 67.59.247.60.static.bjtelecom.net nginx[25793]: nginx: the configuration fi...k
    10月 21 13:52:34 67.59.247.60.static.bjtelecom.net nginx[25793]: nginx: configuration file /...l
    10月 21 13:52:34 67.59.247.60.static.bjtelecom.net systemd[1]: Started The nginx HTTP and re....
    Hint: Some lines were ellipsized, use -l to show in full.

    启动nginx服务

    systemctl start nginx.service

    停止nginx服务

    systemctl stop nginx.service 

     重新启动服务

    systemctl restart nginx.service

    重新读取nginx配置(这个最常用, 不用停止nginx服务就能使修改的配置生效)

    systemctl reload nginx.service

    参考文档:写的超全,又清楚又详细!

    centos7安装Nginx配置自启动命令

    另:最新版本的nginx启动后,通过浏览器访问,不再是熟悉的welcome to nginx页面,而是下面这样子了

     

  • 相关阅读:
    Java08_Lambda表达式
    Java基础02
    Java基础07
    JAVA基础06
    Java基础05
    Java基础01
    面向对象与面向过程
    Java常识2
    CSS常用属性记录
    geoserver发布热力图服务
  • 原文地址:https://www.cnblogs.com/kaerxifa/p/11713199.html
Copyright © 2011-2022 走看看