Andy's Blog » » Apache模块mod_status 好东东啊

Apache模块mod_status 好东东啊

Apache模块mod_status

今天打开了这个mod,简直太好了!可以完美的观测Apache的运行状态

打开httpd.conf

<location /server-status>
    SetHandler server-status
    Order Deny,Allow
    Deny from all
    Allow from all
</location>

重启apache,OK,当然了,这个mod你在装Apache的时候就要装上

报告页面
http://your.server.name/server-status
5秒自动刷新一次
http://your.server.name/server-status?refresh=5
机器可读的状态文件
http://your.server.name/server-status?auto

来看看我的Apache运行状态

报告页面

Apache Server Status for ***

Server Version: Apache/2.2.6 (FreeBSD) mod_ssl/2.2.6 OpenSSL/0.9.7e-p1
Server Built: Nov 10 2007 17:54:46

Current Time: Saturday, 24-Nov-2007 19:48:03 CST
Restart Time: Thursday, 22-Nov-2007 22:04:59 CST
Parent Server Generation: 8
Server uptime: 1 day 21 hours 43 minutes 3 seconds
160 requests currently being processed, 65 idle workers

WWWWWWWWWWWWWWWWWWWWWWWWW.......................................
WWWWWWWWWWWWWWWWWWWWWWWWW.......................................
________K__________CK____.......................................
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW..............
WWWWWWWWWWWWWWWWWWWWWWWWW.......................................
______K____________K__K__.......................................
................................................................
WWWWWWWWWWWWWWWWWWWWWWWWW.......................................
__K___________C____K_W___.......................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................
................................................................

Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

PID Key:

7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 7976 in state: W , 7976 in state: W
7976 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 5000 in state: W
5000 in state: W , 5000 in state: W , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
17616 in state: _ , 17616 in state: K , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
17616 in state: C , 17616 in state: K , 17616 in state: _
17616 in state: _ , 17616 in state: _ , 17616 in state: _
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 4765 in state: W
4765 in state: W , 4765 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
9868 in state: W , 9868 in state: W , 9868 in state: W
17620 in state: _ , 17620 in state: _ , 17620 in state: _
17620 in state: _ , 17620 in state: _ , 17620 in state: _
17620 in state: K , 17620 in state: _ , 17620 in state: _
17620 in state: _ , 17620 in state: _ , 17620 in state: _
17620 in state: _ , 17620 in state: _ , 17620 in state: _
17620 in state: _ , 17620 in state: _ , 17620 in state: _
17620 in state: _ , 17620 in state: K , 17620 in state: _
17620 in state: _ , 17620 in state: K , 17620 in state: _
17620 in state: _ , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 7309 in state: W
7309 in state: W , 7309 in state: W , 17615 in state: _
17615 in state: _ , 17615 in state: K , 17615 in state: _
17615 in state: _ , 17615 in state: _ , 17615 in state: _
17615 in state: _ , 17615 in state: _ , 17615 in state: _
17615 in state: _ , 17615 in state: _ , 17615 in state: _
17615 in state: _ , 17615 in state: C , 17615 in state: _
17615 in state: _ , 17615 in state: _ , 17615 in state: _
17615 in state: K , 17615 in state: _ , 17615 in state: W
17615 in state: _ , 17615 in state: _ , 17615 in state: _

To obtain a full report with current status information you need to use the ExtendedStatus On directive.

机器可读的状态文件

BusyWorkers: 157
IdleWorkers: 68
Scoreboard: WWWWWWWWWWWWWWWWWWWWWWWWW.......................................WWWWWWWWWWWWWWWWWWWWWWWWW......................................._____W__C___________K____.......................................WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW..............WWWWWWWWWWWWWWWWWWWWWWWWW.......................................___________K____K_C______.......................................................................................................WWWWWWWWWWWWWWWWWWWWWWWWW.......................................___________________W_____.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

-------------------------------------------------------------
附:Apache手册中关于mod_status的部份

说明 生成描述服务器状态的Web页面
状态 基本(B)
模块名 status_module
源文件 mod_status.c
概述

本模块允许服务器管理员方便的检查服务器当前的运行状况。该模块用一种容易阅读的表格报告服务器的当前运行状态并以HTML页面的方式呈现出来。如果你愿意,还可以让这个页面不停的自动刷新(仅在支持自动刷新的浏览器上有效)。另外还可以提供一个简单的供机器阅读的服务器当前状态表。

输出的详细信息如下:

* 正在伺服请求的工作者(线程或进程)数量
* 空闲的工作者数量
* 每个工作者的状态:已完成的请求数、已发送的字节数。(*)
* 总访问数和已发送的字节总数(*)
* 服务器自启动/重启以来经过的时间,服务器已经运行的时间。
* 平均每秒请求数,平均每秒发送的字节数,平均每个请求发送的字节数。(*)
* 每个工作者的当前CPU使用百分率,以及Apache的当前总计CPU使用百分率。(*)
* 当前正在被处理的主机和请求(*)

必须使用相应编译时选项才能显示被标记为"(*)"的信息,因为这些信息默认并不存在于Apache中。

注意:如果mod_status被静态编译进了服务器,那么该处理器将在所有配置文件(包括.htaccess)中可用。这可能会导致某些安全问题。

Incoming search terms:

Tags: apache, mod_status

本文地址: http://www.21andy.com/new/20071124/693.html

1 评论 to “PHP开源CMS之MODx”

  1. 夏晗 于 2010-05-20 10:29:32 发表:

    问下,我配置了这个,但是输入网址,说没找到这个路径,这有可能是什么原因产生的啊?是不是没安装这个MOD模块啊,该怎么安装啊!?