Max*_*Max 9 mod-rewrite munin ubuntu-10.04 apache-2.2
我apache_
在 munin 节点上启用了插件:
ln -sv /usr/share/munin/plugins/apache_* /etc/munin/plugins/
用service munin-node restart
这里重新启动节点后,我得到了错误:
$ munin-node-configure --suggest 2>/dev/null | grep "apache\|Plugin\|------"
Plugin | Used | Suggestions
------ | ---- | -----------
apache_accesses | yes | no [apache server-status not found. check if mod_status is enabled]
apache_processes | yes | no [apache server-status not found. check if mod_status is enabled]
apache_volume | yes | no [apache server-status not found. check if mod_status is enabled]
Run Code Online (Sandbox Code Playgroud)
但是mod_status
已经启用:
$ a2enmod status
Module status already enabled
Run Code Online (Sandbox Code Playgroud)
重新启动 apache 并没有什么区别。
如果我尝试手动运行插件,这就是我得到的(我读到获得 U 是个坏消息,所以至少这是一致的)。
$ munin-run apache_accesses --debug
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Set /rgid/ruid/egid/euid/ to /110/65534/110 110 /65534/
# Setting up environment
# About to run '/etc/munin/plugins/apache_accesses'
accesses80.value U
$ munin-run apache_processes --debug
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Set /rgid/ruid/egid/euid/ to /110/65534/110 110 /65534/
# Setting up environment
# About to run '/etc/munin/plugins/apache_processes'
busy80.value U
idle80.value U
free80.value U
$ munin-run apache_volume --debug
# Processing plugin configuration from /etc/munin/plugin-conf.d/munin-node
# Set /rgid/ruid/egid/euid/ to /110/65534/110 110 /65534/
# Setting up environment
# About to run '/etc/munin/plugins/apache_volume'
volume80.value U
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么我仍然收到server-status not found
消息以及如何摆脱它?
更新答案 1
Shane 关于在 apache 站点中使用Location
和设置请求处理程序的建议是正确的SetHandler
。有关更多信息,mod_status
请参阅此页面
我可以munin
通过查看/var/log/apache2/access.log
我在哪里得到这个来验证它是否有效地提出了适当的请求:
127.0.0.1 - - [10/Nov/2011:07:24:15 +0000] "GET /server-status?auto HTTP/1.1" 404 7774 "-" "libwww-perl/5.834
Run Code Online (Sandbox Code Playgroud)
在我的情况下,设置Location
还不够,因为我正在运行一个Drupal
站点,并且.htaccess
结合了mod_rewrite
重写请求。要修复它,我必须将以下行添加到我的.htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} !=/server-status # <= added this line
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
请注意,这并不代表安全问题,因为访问/server-status
仅限127.0.0.1
于 apache 站点。
更新了答案 2
似乎Location
根本不需要将 添加到 apache 站点,因为这已经在/etc/apache2/mods-enabled/status.conf
. 顺便说一句,如果你想添加ExtendedStatus On
指令,那在你应该做的那个文件中。
似乎它正在尝试实际向状态模块发出请求。你的状态位置有正确的配置VirtualHost
吗?像这样的东西:
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
Run Code Online (Sandbox Code Playgroud)
小智 5
我在这个网站上找到了 Many Ayromlou 的解决方案:
\n\n\n问题是,wordpress 中的这些 .htaccess 规则接管了在 apache\xe2\x80\x99s 配置中激活的服务器信息和服务器状态 URL,并返回页面未找到错误。\n我遇到了许多网站,建议添加类似规则:
\nRun Code Online (Sandbox Code Playgroud)\nRewriteCond %{REQUEST_URI} !=/server-status\n
这对我不起作用。我不确定 WordPress 的多站点版本(我正在使用)是否导致了这种情况。效果很好的规则如下:
\nRun Code Online (Sandbox Code Playgroud)\nRewriteRule ^(server-info|server-status) - [L]\n
每当 server-info 或 server-status 被解析为 URL 的一部分时,此规则就会停止重写引擎。
\n
归档时间: |
|
查看次数: |
25519 次 |
最近记录: |