1

我正在尝试配置 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
4

1 回答 1

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
于 2015-01-10T23:04:20.993 回答