zoukankan      html  css  js  c++  java
  • Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面

              Httpd服务入门知识-Httpd服务常见配置案例之Apache的工作做状态status页面

                                                    作者:尹正杰

    版权声明:原创作品,谢绝转载!否则将追究法律责任。

    一.status功能概述

    status页面可以显示出Apache的工作状态,有助于咱们了解Apache服务是否工作正常
    
    默认status模块是动态加载的哟:
      [root@node101.yinzhengjie.org.cn ~]# httpd -M | grep status_module
       status_module (shared)
      [root@node101.yinzhengjie.org.cn ~]# 
    
    博主推荐阅读:
      http://httpd.apache.org/docs/2.4/mod/core.html#SetHandler

    二.启用status功能

    1>.修改httpd的配置文件

    [root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf  | grep ServerRoot
    ServerRoot "/etc/httpd"
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf  | grep IncludeOptional
    IncludeOptional conf.d/*.conf
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# cat /etc/httpd/conf.d/status.conf 
    <Location "/myweb">        #注意,客户端在浏览器访问的是"/myweb"关键词(该关键词咱们可以自定义哟~)就会调用下面我们定义的"server-status"功能模块的信息
        SetHandler server-status
    </Location>
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# httpd -M | grep status_module
     status_module (shared)
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# httpd -t
    Syntax OK
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# systemctl reload httpd
    [root@node101.yinzhengjie.org.cn ~]# 

    2>.测试web页面

      在浏览器输入:"http://node101.yinzhengjie.org.cn/myweb"就可以看到咱们的httpd服务器的工作状态,效果如下图所示。

    三.显示扩展信息配置

    1>.修改httpd的配置文件

    [root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf  | grep ServerRoot
    ServerRoot "/etc/httpd"
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# egrep -v "^ *#|^$" /etc/httpd/conf/httpd.conf  | grep IncludeOptional
    IncludeOptional conf.d/*.conf
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# cat /etc/httpd/conf.d/status.conf 
    <Location "/myweb">
        SetHandler server-status
    </Location>
    ExtendedStatus On          #将其值设置为On就会看到更多详细信息
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# httpd -M | grep status_module
     status_module (shared)
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# httpd -t
    Syntax OK
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# systemctl reload httpd
    [root@node101.yinzhengjie.org.cn ~]# 
    [root@node101.yinzhengjie.org.cn ~]# 

    2>. 测试试验效果

     

      经测试,发现官方文档是由错误的,因为我们修改ExtendedStatus的属性值是ON发现变化并不大。于是我们将ExtendedStatus的属性值是Off发现的确是有差异的哟~
    
      上图是ExtendedStatus的值为On
    
      下图是ExtendedStatus的值为Off

      从输出结果来看的确是将ExtendedStatus的值设置为On会看到更多的信息哟~

     

  • 相关阅读:
    EzHttp 流传输调用代码示例
    使用EzHttp框架 开发基于HTTP协议的CS轻应用
    [转]Installing Memcached on Windows
    SQLiteServer+SQLiteClient 用于.Net项目的SQLite服务端程序和客户端类库
    ERROR: Pillow-5.2.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
    Linux下的tar压缩解压缩命令详解
    scp 基于 SSH 的安全远程服务器文件拷贝
    大批量删除列表中元素的方法,自己用本办法做的
    Python 列表 pop() 方法
    可遍历的数据对象enumerate() 方法的使用
  • 原文地址:https://www.cnblogs.com/yinzhengjie/p/12006761.html
Copyright © 2011-2022 走看看