apache加入mod_status,mod_info 监控Server状态
apache模块学习笔记系列--mod_status,mod_info
环境:WinXP,Appserv2.5.9(Apache/2.2.4 (Win32) PHP/5.2.3 Server at 127.0.0.1 Port 82) 安装路径:D:\AppServ\
第一、加载mod_status.so,mod_info.so模块
#LoadModule status_module modules/mod_status.so
#LoadModule info_module modules/mod_info.so
去掉#,加载mod_status.so,mod_info.so
第二、httpd.conf文件增加Include conf/extra/httpd-info.conf ,引入mod_status.so,mod_info.so的配置文件。
httpd-info.conf:
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_status (for the server-status handler),
# mod_info (for the server-info handler)
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".appservnetwork.com" to match your domain to enable.
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from all
</Location>
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
#ExtendedStatus On
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".appservnetwork.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from all
</Location>
第三、URL进行访问
1、http://127.0.0.1:82/server-status
http://127.0.0.1:82/server-status?refresh=N访问状态页面可以每N秒自动刷新一次。
http://127.0.0.1:82/server-status?auto 获得一个面向机器可读的状态文件
2、http://127.0.0.1:82/server-info
转自:http://hi.baidu.com/longhtml/item/219523610cca6e90c5d249fa?qq-pf-to=pcqq.c2c
posted on 2013-12-20 21:48 javaWorkspace 阅读(1420) 评论(0) 编辑 收藏 举报