osapub 发表于 2013-05-16 16:30

Lighttpd


Lighttpd配置mod_status

先配置加载lighttpd的mod_status模块,有两种方法。




第一种方法:

1,编辑lighttpd的module.conf 配置文件,加载mod_status模块,并取消include "conf.d/status.conf" 注释。
          server.modules =(
                        "mod_access";
                         " mod_status";
                            ……
                           )


2, 编辑mod_status 的配置文
            #cd conf.d
            #vimstatus.conf
            #server.modules += ( "mod_status" )


注:注释此项因为已经在module.conf中已经加载了该模块,如果再次加载,会报下面的错误
   Starting lighttpd: 2010-09-09 02:33:15: (plugin.c.131) Cannot load plugin mod_status more than once, please fix your config (we may not accept such      configs in future releases

   $HTTP["remoteip"] == "192.168.1.88" {
    #注:此项是设置 允许那台主机访问http://ip/server-status 这个页面,来查看lighttpd的工作状态
                  status.status-url          = "/server-status"
                  status.config-url          = "/server-config"
                  status.statistics-url      = "/server-statistics"
                  status.enable-sort         = "enable"
   }



第二种方法就是在module.conf文件中只需要取消include “conf.d/status.conf” 注释,并编辑mod_status的配置文件
             server.modules += ( "mod_status" )
             $HTTP["remoteip"] == "192.168.1.88" {
                            status.status-url          = "/server-status"
                            status.config-url          = "/server-config"
                            status.statistics-url      = "/server-statistics"
                            status.enable-sort         = "enable"
            }


注意,上文中的IP地址,您需要根据实际情况,填写OSA监控精灵服务端所在的IP地址。

重启lighttpd服务后,检查配置是否正确,访问:
http://ip/server-status
http://ip/server-config
http://ip/server-statistics


Lighttpd自定义告警指标
   Lighttpd并发连接数(单位:数值)         
   Lighttpd吞吐率(单位: reqs/s)

页: [1]
查看完整版本: Lighttpd