51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4362|回复: 20
打印 上一主题 下一主题

[原创] LR监控apache

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2008-3-11 16:10:02 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
按照论坛中信息修改相关设置:
打开<Apache Installation>\conf\httpd.conf,进行如下修改:
1、  设置允许查看Apache运行状态的主机
#
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your-domain.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-status>
    SetHandler                                        server-status
    Order                                                 allow,deny
    Deny from                                         nothing
    Allow from                                         all
</Location>
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息!!!

为什么我修改上面的配置后,重新启动Apache在浏览器中输入http://servername/server-status看不到任何信息,提示找不到服务器???什么原因呢??
<Apache Installation>\conf\httpd.conf中有#LoadModule status_module modules/mod_status.so 语句,,但是我把#给去掉时,重启apache会报语法错误!!!

[ 本帖最后由 zhuyuancan 于 2008-3-11 16:13 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

21#
发表于 2008-3-12 18:15:23 | 只看该作者
楼上的同学解决了么?
回复 支持 反对

使用道具 举报

该用户从未签到

20#
发表于 2008-3-11 19:04:00 | 只看该作者
楼上需要做几个事情
1)
[search@b2bsearch145 conf]$ /usr/local/apache2/bin/httpd  -l
Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

确认是否mod_status是否已经被编译入apache了。

确保服务器 apache httpd.conf 配置正确,要把 #ExtendedStatus On   打开
以及loadmodule  ....

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Allow from all
</Location>
确保  IE 打开 http://servername/server-status  有数据

2) loadrunner 目录的apache 配置文件版本和服务器匹配

[ 本帖最后由 liangjz 于 2008-3-11 19:05 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

19#
 楼主| 发表于 2008-3-11 18:00:59 | 只看该作者
就是因为看了大量的资料都搞不顶啊
回复 支持 反对

使用道具 举报

该用户从未签到

18#
发表于 2008-3-11 17:58:24 | 只看该作者
Apache 配置问题
网上搜索能找到大量的解决方法.
放在这里讨论实在是没什么意义.
回复 支持 反对

使用道具 举报

该用户从未签到

17#
 楼主| 发表于 2008-3-11 17:49:44 | 只看该作者
是不是要加载mod_status.so 和mod_info.so
回复 支持 反对

使用道具 举报

该用户从未签到

16#
 楼主| 发表于 2008-3-11 17:41:46 | 只看该作者
偶的好象是2.0.0.59,记不得了,反正是2.x的
[Apache]
Counters=5
Counter0=IdleWorkers
Label0=#Idle Workers (Apache)
Description0=Number of server children in the Idle state.

Counter1=Total Accesses
Label1=Hits/sec (Apache)
Description1=The HTTP request rate.
KeepPrevValue1=1

Counter2=Total kBytes
Label2=KBytes Sent/sec (Apache)
KeepPrevValue2=1
Description2=The rate at which data bytes are sent from the Web server.

Counter3=CPULoad
Label3=Apache CPU Usage (Apache)
Description3=Percentage of time the CPU is utilized by the Apache server.

Counter4=BusyWorkers
Label4=#Busy Workers (Apache)
Description4=Number of server children in the Busy state

Delimiter=:
infoURL=/server-status?auto
serverPort=80
SamplingRate=0


[ProxySettings]
; By default, if this flag set to 1 monitor will try to obtain proxy information from
; setting of IE
useProxy=1
proxyUsername=
proxyPassword=
proxyDomain=

; Format: [<protocol>=][<scheme>://]<proxy>[:<port>][ [<protocol>=][<scheme>://]<proxy>[:<port>]]
; E.g., httpProxy=http=http://my_http_proxy:8080 https=https://my_https_proxy:9000
httpProxy=


区别就是Description中的信息
回复 支持 反对

使用道具 举报

该用户从未签到

15#
发表于 2008-3-11 17:31:46 | 只看该作者

我的apache版本是2.2.4的

我把我的apache.cfg给你来一份,要是还不行,明天在帮你找原因,马上下班了
你把你现在的apache.cfg复制保留一份,在把下面的覆盖到你的apache.cfg

[Apache]
Counters=5
Counter0=IdleWorkers
Label0=Idle Workers (Apache)
Description0=Number of servers in the Idle state.

Counter1=Total Accesses
Label1=Hits/sec (Apache)
Description1=The HTTP request rate.
KeepPrevValue1=1

Counter2=Total kBytes
Label2=KBytes Sent/sec (Apache)
KeepPrevValue2=1
Description2=The rate at which data bytes are sent from the Web server.

Counter3=CPULoad
Label3=Apache CPU Usage (Apache)
Description3=Percentage of time the CPU is utilized by the Apache server.

Counter4=BusyWorkers
Label4=Busy Workers (Apache)
Description4=Number of servers in the Busy state

Delimiter=:
infoURL=/server-status?auto
serverPort=80
SamplingRate=0


[ProxySettings]
; By default, if this flag set to 1 monitor will try to obtain proxy information from
; setting of IE
useProxy=1
proxyUsername=
proxyPassword=
proxyDomain=

; Format: [<protocol>=][<scheme>://]<proxy>[:<port>][ [<protocol>=][<scheme>://]<proxy>[:<port>]]
; E.g., httpProxy=http=http://my_http_proxy:8080 https=https://my_https_proxy:9000
httpProxy=
回复 支持 反对

使用道具 举报

该用户从未签到

14#
 楼主| 发表于 2008-3-11 17:22:13 | 只看该作者
看到这样一篇文章:也是针对上面的:
因为<Installation>\dat\monitors\apache.cfg针对apache 1.x的status指标,与apache 2.0度量指标失配。
故采用apache_2.0.x.cf g更名apache.cfg。

修改后我点击ADD measurement 时,仅弹出个消息框,内容为:random
回复 支持 反对

使用道具 举报

该用户从未签到

13#
 楼主| 发表于 2008-3-11 17:20:04 | 只看该作者
试国了,去掉#号,重启apache时提示语法错误
回复 支持 反对

使用道具 举报

该用户从未签到

12#
发表于 2008-3-11 17:17:38 | 只看该作者
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息,而输入http://servername/server-status?auto就会看到如下信息:
  Total Accesses: 124
  Total kBytes: 444
  CPULoad: 3.32432
  Uptime: 37
  ReqPerSec: 3.35135
  BytesPerSec: 12288
  BytesPerReq: 3666.58
  BusyWorkers: 1
  IdleWorkers: 7
  Scoreboard: ____W___.........................
  看到这样的信息就表示修改成功,这样就可以使用LoadRunner监视Apache了
回复 支持 反对

使用道具 举报

该用户从未签到

11#
发表于 2008-3-11 17:16:19 | 只看该作者
LoadModule status_module modules/mod_status.so

这个前面的#号去掉
回复 支持 反对

使用道具 举报

该用户从未签到

10#
 楼主| 发表于 2008-3-11 17:06:11 | 只看该作者
能否请版主明示一下,,刚刚接手LR,以前都是搞QTP
回复 支持 反对

使用道具 举报

该用户从未签到

9#
发表于 2008-3-11 17:02:24 | 只看该作者
请注意:监控apache2的loarunner 目录下的配置文件不同apache1的
回复 支持 反对

使用道具 举报

该用户从未签到

8#
 楼主| 发表于 2008-3-11 17:02:20 | 只看该作者
apache中的有关配置:

listen 80
#/mod_status
#example:
#LoadModule status_module modules/mod_status.so
#LoadModule jk_module modules/mod_jk.so
#LoadModule foo_module modules/mod_foo.so

<Location /server-status>
    SetHandler                                        server-status
    Order                                                 allow,deny
    Deny from                                         nothing
    Allow from                                         all
</Location>

等待解决中.................

[ 本帖最后由 zhuyuancan 于 2008-3-11 17:48 编辑 ]
回复 支持 反对

使用道具 举报

该用户从未签到

7#
 楼主| 发表于 2008-3-11 16:56:23 | 只看该作者
效果还是一样的!!还是表示感谢一下!!!明察秋毫中................................
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2008-3-11 16:54:52 | 只看该作者
原帖由 zhuyuancan 于 2008-3-11 16:38 发表
主要是:“重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息!!!”这句话的内容都没有实现,,是不是Apache某些配置的原因!!!

那估计是你apache的设置问题吧 或者apache没有启动
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2008-3-11 16:46:41 | 只看该作者

apache.cfg上面需要的东西,我复制一份给你希望有用

[Apache]
Counters=5
Counter0=IdleWorkers
Label0=Idle Workers (Apache)
Description0=Number of servers in the Idle state.

Counter1=Total Accesses
Label1=Hits/sec (Apache)
Description1=The HTTP request rate.
KeepPrevValue1=1

Counter2=Total kBytes
Label2=KBytes Sent/sec (Apache)
KeepPrevValue2=1
Description2=The rate at which data bytes are sent from the Web server.

Counter3=CPULoad
Label3=Apache CPU Usage (Apache)
Description3=Percentage of time the CPU is utilized by the Apache server.

Counter4=BusyWorkers
Label4=Busy Workers (Apache)
Description4=Number of servers in the Busy state

Delimiter=:
infoURL=/server-status?auto
serverPort=80
SamplingRate=0
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2008-3-11 16:38:02 | 只看该作者
主要是:“重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息!!!”这句话的内容都没有实现,,是不是Apache某些配置的原因!!!
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2008-3-11 16:31:21 | 只看该作者
谢谢54111的回答,,我先前在LR上也按照上面的设置设置完了!!!但是
lr还是提示
Monitor name :Apache. Parsing error, cannot find token: BusyServers. Measurement: BusyServers|192.168.0.186. Hints: 1) Such a measurement does not exist, or the html page may be different from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>\dat\monitors and rerun the application (entry point: CApacheMeasurement::NewData). [MsgId: MMSG-47479
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-22 13:41 , Processed in 0.086058 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表