Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10198134
  • 博文数量: 1669
  • 博客积分: 16831
  • 博客等级: 上将
  • 技术积分: 12594
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 07:23
个人简介

柔中带刚,刚中带柔,淫荡中富含柔和,刚猛中荡漾风骚,无坚不摧,无孔不入!

文章分类

全部博文(1669)

文章存档

2023年(4)

2022年(1)

2021年(10)

2020年(24)

2019年(4)

2018年(19)

2017年(66)

2016年(60)

2015年(49)

2014年(201)

2013年(221)

2012年(638)

2011年(372)

分类: 系统运维

2012-09-29 10:05:46

监控基于Linux主机的Apache  

2012-09-27 15:53:39|  分类: rhel_监控 |  标签: |字号 

8.1 要监控基于Linux主机的Apache,可以在添加主机时直接选择“Linux主机-Apahce”主机模板。

8.2 在被监控的Linux主机上,需要对Apache做以下配置:

8.2.1 加载mod_status.so模块。大多数Apache已经加载了该模块,但您依然需要检查您的Apache是否已加载该模块。编辑您的httpd.conf,查看是否有以下行:
LoadModule status_module modules/mod_status.so

如果没有,您需要手动添加。如果加载该模块失败,您需要重新编译Apache或复制可用的模块文件,然后加载

8.2.2 启用Aapche的状态功能,编辑您的httpd.conf,添加以下设置:
ExtendedStatus On

    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 192.168.254.253

修改192.168.254.253为您的CactiEZ中文版IP地址。

8.3.3 保存退出并重启Apache

8.4 测试Apache配置是否成功,登录CactiEZ中文版,输入:
# links 服务器IP/server-status

8.5 如果能看到类似以下数据表示Apache配置成功:
Apache Server Status for 192.168.0.20
Server Version: Apache/2.2.15 (Unix) DAV/2 
Server Built: Aug 14 2010 08:53:20

--------------------------------------------------------------------------------

Current Time: Friday, 04-Mar-2011 12:38:23 CST 
Restart Time: Friday, 04-Mar-2011 12:38:21 CST 
Parent Server Generation: 0 
Server uptime: 1 second 
Total accesses: 0 - Total Traffic: 0 kB 
CPU Usage: u0 s0 cu0 cs0
0 requests/sec - 0 B/second - 
1 requests currently being processed, 7 idle workers 
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

Srv PID Acc M CPU  SS Req Conn Child Slot Client VHost Request 
0-0 23152 0/0/0 W  0.00 0 0 0.0 0.00 0.00  192.168.0.1 cactiez.local GET /server-status HTTP/1.1

 

--------------------------------------------------------------------------------
Srv Child Server number - generation 
PID OS process ID 
Acc Number of accesses this connection / this child / this slot 
M Mode of operation 
CPU CPU usage, number of seconds 
SS Seconds since beginning of most recent request 
Req Milliseconds required to process most recent request 
Conn Kilobytes transferred this connection 
Child Megabytes transferred this child 
Slot Total megabytes transferred this slot

8.6 如果看到类似以下数据则表示您的“Allow from”字段有问题:
Forbidden
You don't have permission to access /server-status on this server.
--------------------------------------------------------------------------------

Apache Server at 192.168.0.20 Port 80

阅读(1235) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~