监控宝对apache的监控以及遇到问题解决
- 10 九月, 2010 //
- 系统与网络 //
- Tags :
- 0 Comments
今天服务器又不间断访问慢,从监控宝的linux系统监控来看没有问题,网络访问有一些特别:电信特别慢,网通很正常。
为了更好地排除问题,于是对apache也进行了监控,具体方法可以参见
1.apache开启server-status
2.监控宝控制台添加新的服务监控项 http:/.jiankongbao.com/?p=422
我在监控宝的面板添加 http://域名/server-status 时,老是提示不是一个正确的url,开始以为这个“server-status ”是一个目录,然后ftp上去一个目录也不行。
接下来检查apache的配置文件, 发现conf/extra下面有个httpd-info.conf,把httpd.conf里的那段配置移到这个文件里面来,重启apache,访问http://域名/server-status时,提示404错误,我汗。
google了很久,发现有篇文章说到了这个问题,大概是两种解决方法,一种是apache再监听一个8080端口,二是在指定虚拟主机时,不要用*:80,而要写明ip地址。我觉得在进行如此大的操作之前再自己看看自己有没有遗漏的地方,重新检查一下httpd.conf文件,发现里面有一行include /conf/extra/httpd-info.conf没有去掉注释。。。原来如此。。。重启,搞定,监控宝提示已经正常开始监听了。
google的那篇原文如下,如果还不能解决,这个可能是最后的救命稻草了:http://systembash.com/content/apache-mod_status-404/
Apache mod_status and page not found 404Problem: Checking the [tag]apache[/tag] server status with the command “apachectl status”, “service httpd fullstatus” or by viewing http://server/server-status I get the message: “The requested URL /server-status was not found on this server” or your alternative 404 page not found error.Answer: Assuming you have the module loaded and set up per the documentation of mod_status, this is this most likely a VirtualHost problem.If you use NameVirtualHost *:80 directive, or any *:port, to run multiple name based virtual hosts, this configuration does not allow server-status on any of the publicly accessible addresses. This is because the first Virtual Host in the directive is considered the “Default Virtual Host”, any unknown entries on the NameVirtualHost space – in this example anything accessing port 80 on any IP address, will default go to this virtual host and hence you will get a 404 page not found error. Furthermore you can not place the server-status configuration inside of a VirtualHost directive to be read from a full domain name.Solution: There are two basic ways to solve this. The first is to make the server listen on an alternative port (such as port 8080). Adding “Listen 8080″ to the configuration will allow you to access the server status from http://yourip:8080/server-status.The second will allow the command ‘apachectl status’ or ‘service httpd fullstatus’ to work properly but it will not allow external access. If you switch each * to the actual IP address to work from, then accessing from localhost (127.0.0.1) will work. So, you would need tochange:NameVirtualHost *:80toNameVirtualHost 10.0.0.3:80And then restart your server.By that way, unless you need it, make sure to turn ExtendedStatus Off. This directive collects a lot of data from the site visitors and can slow down a busy server.Apache mod_status and page not found 404Problem: Checking the [tag]apache[/tag] server status with the command “apachectl status”, “service httpd fullstatus” or by viewing http://server/server-status I get the message: “The requested URL /server-status was not found on this server” or your alternative 404 page not found error.
Answer: Assuming you have the module loaded and set up per the documentation of mod_status, this is this most likely a VirtualHost problem.
If you use NameVirtualHost *:80 directive, or any *:port, to run multiple name based virtual hosts, this configuration does not allow server-status on any of the publicly accessible addresses. This is because the first Virtual Host in the directive is considered the “Default Virtual Host”, any unknown entries on the NameVirtualHost space – in this example anything accessing port 80 on any IP address, will default go to this virtual host and hence you will get a 404 page not found error. Furthermore you can not place the server-status configuration inside of a VirtualHost directive to be read from a full domain name.
Solution: There are two basic ways to solve this. The first is to make the server listen on an alternative port (such as port 8080). Adding “Listen 8080″ to the configuration will allow you to access the server status from http://yourip:8080/server-status.
The second will allow the command ‘apachectl status’ or ‘service httpd fullstatus’ to work properly but it will not allow external access. If you switch each * to the actual IP address to work from, then accessing from localhost (127.0.0.1) will work. So, you would need tochange:NameVirtualHost *:80
toNameVirtualHost 10.0.0.3:80
And then restart your server.
By that way, unless you need it, make sure to turn ExtendedStatus Off. This directive collects a lot of data from the site visitors and can slow down a busy server.


