我正在尝试配置Httpd插件
我收到403错误,有任何建议如何解决此问题
INFO 2014-12-16 19:52:14,885 14962 MainProcess MainThread newrelic_plugin_agent.agent __init__ L55 : Agent v1.3.0 initialized, Linux-2.6.32-431.29.2.el6.x86_64-x86_64-with-glibc2.2.5 (CentOS 6.5 Final) CPython v2.6.6
INFO 2014-12-16 19:52:14,886 14962 MainProcess MainThread helper.controller run L251 : newrelic-plugin-agent v2.4.1 started
INFO 2014-12-16 19:52:14,886 14962 MainProcess MainThread newrelic_plugin_agent.agent start_plugin_polling L263 : Enabling plugin: apache_httpd
ERROR 2014-12-16 19:52:19,450 14962 MainProcess MainThread newrelic_plugin_agent.plugins.base http_get L354 : Error response from localhost:80/server-status?auto (403):
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /server-status
on this server.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at localhost Port 80</address>
</body></html>
ERROR 2014-12-16 19:52:19,451 14962 MainProcess MainThread newrelic_plugin_agent.plugins.apache_httpd error_message L61 : Could not match any of the stats, please make ensure Apache HTTPd is configured correctly. If you report this as a bug, please include the full output of the status page from localhost:80/server-status?auto in your ticket
WARNING 2014-12-16 19:52:19,451 14962 MainProcess MainThread newrelic_plugin_agent.agent send_components L217 : No metrics to send to NewRelic this interval
INFO 2014-12-16 19:52:19,451 14962 MainProcess MainThread newrelic_plugin_agent.agent process L133 : Stats processed in 4.57 seconds, next wake in 55 seconds
答案 0 :(得分:1)
如果您喜欢在单独的文件中添加以下行到 /etc/httpd/conf/httpd.conf 的末尾,然后创建一个文件,例如 / etc / httpd / conf.d / status.conf 并将它们放在那里。
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
这就是说您要在/ server-status uri上公开服务器状态。它也只允许来自127.0.0.1的连接,这意味着您只允许从直接从服务器发出的请求中为此页面提供服务。
完成更改后,请确保运行:
service httpd restart
然后,您可以通过执行以下任何操作来验证它是否正常工作,具体取决于您的系统配置。
lynx --dump http://127.0.0.1/server-status
curl -vs http://127.0.0.1/server-status
wget -qO- http://127.0.0.1/server-status