<Solved> How do I enable the server-status page in Apache?

Linode Staff

Anytime I try to access /server-status I get a 404.

I am trying to do this in CentOS 7

2 Replies

You are going to want to ensure mod_status is enabled.

$ sudo a2enmod status

Since you are on CentOS, you will then want to ensure the following is in the /etc/httpd/httpd.conf file.

<IfModule mod_status.c>
    ExtendedStatus On
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>

Note: the above example only serves /server-status on localhost. It will not be visible to visitors over the public internet. The Apache documentation below provides an example if you want this to be visible to all visitors.

Finally, for the change take effect, you'll need to restart httpd.

$ sudo systemctl restart httpd.service

Additional documentation can be found in the Apache docs, as well as the Linode Longview documentation.

Thanks, I found that I had to use these statements to make it work:

ExtendedStatus On
<Location /server-status>
    SetHandler server-status
    Require all denied
    Require local
</Location>

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct