在 Apache 2.4 上的 Web 服务器上,获取 httpd fullstatus 时出现问题

在 Apache 2.4 上的 Web 服务器上,获取 httpd fullstatus 时出现问题

我有一个 Web 服务器,我正在将其迁移到 RHEL7 (httpd 2.2 -> 2.4)。在我们的旧服务器 (2.2) 中,我们可以执行 httpd fullstatus,它会显示服务器上有关 apache 的大量有用信息。

在 apache 2.4 服务器上,我无法让 fullstatus 命令正常工作。以下是我采取的步骤列表(根据互联网上的各种指南汇编而成)-

1.) - 检查 status_module 是否启用。 httpd -M | grep status返回status_module (shared)

2.) - 将模块添加到 httpd.conf -

<IfModule mod_status.c>
    <Location "/server-status">
        SetHandler server-status
        Require host <my hostname>
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1

    </Location>
</IfModule>

3.) - 在 conf.modules.d/ 中创建一个 conf 文件(内容与上文相同) -

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

完成所有这些操作后,我重新加载/重新启动了 apache,但仍然无法让 httpd fullstatus 正常工作。

注意 - 我也单独完成了这两个步骤,但没有成功,这就是为什么我将它们放在一起,希望它能够起作用。

你们对我下一步该做什么有什么想法吗?

谢谢。

编辑-这是我尝试运行 httpd fullstatus 时的当前输出-

[username@hostname]# httpd fullstatus
    Usage: httpd [-D name] [-d directory] [-f file]
             [-C "directive"] [-c "directive"]
             [-k start|restart|graceful|graceful-stop|stop]
             [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]

EDIT2-运行 apachectl fullstatus 时,出现权限被拒绝错误-

                               Forbidden

 You don't have permission to access /server-status on this server.

答案1

fullstatusapachectl命令,而不是 httpd。从使用输出来看,这听起来像是这里的问题。尝试

apachectl fullstatus

相关内容