• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

how to view server-status in plesk enabled centos server.

JohnBritto

New Pleskian
Hi ,

I have removed # under httpd.conf and my httpd.conf for server-status are:

ExtendedStatus On

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

when i do lynx http://localhost/server-status . either i get 403 forbidden message. in browser i get redirected to http://localhost/login and it gives 403.

Any way i could see apache server-status on my centos 5.7 64bit with plesk .

Note: I gave the above "server-status" code in vhost.conf under one of my subdomain ( test.domain.com) and when accessing it via http://test.domain.com/server-status .. it works. I am looking to make it work under localhost for a nagiosxi plugin developement.

Thanks in advance.
Awaiting response.
 
Last edited:
when i do lynx http://localhost/server-status . either i get 403 forbidden message. in browser i get redirected to http://localhost/login and it gives 403.

It sounds as though you have a lot of different things going on, and potentially that you have some .htaccess mod_rewrite rules going on that may be causing you problems.

First, in a Plesk/redhat/centos-like environment, rather than editing and adding to httpd.conf, it is best to create a file called mod_status.conf in /etc/httpd/conf.d/ containing something similar to what you have added:

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

(and don't forget to restart apache afterwards)

Second, when you do this, the change is global. It applies to all domains. This includes http://ip-address-of-your-server/server-status
Indeed, the nagios plugin I happen to use addresses the host by IP address.

Third, why not add the public IP address of your server to the Allow from line, and try addressing the server by public IP or public domain name.

Fourthly, being redirected to the login page really makes me thing that's your real problem more than any other issue. But by addressing the server by IP address, you may get around it. Note that Plesk will serve whatever domain is set as the default domain for that IP address, so if it is the same one you are having problems with then this won't help.
 
It sounds as though you have a lot of different things going on, and potentially that you have some .htaccess mod_rewrite rules going on that may be causing you problems.

First, in a Plesk/redhat/centos-like environment, rather than editing and adding to httpd.conf, it is best to create a file called mod_status.conf in /etc/httpd/conf.d/ containing something similar to what you have added:

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

(and don't forget to restart apache afterwards)

Second, when you do this, the change is global. It applies to all domains. This includes http://ip-address-of-your-server/server-status
Indeed, the nagios plugin I happen to use addresses the host by IP address.

Third, why not add the public IP address of your server to the Allow from line, and try addressing the server by public IP or public domain name.

Fourthly, being redirected to the login page really makes me thing that's your real problem more than any other issue. But by addressing the server by IP address, you may get around it. Note that Plesk will serve whatever domain is set as the default domain for that IP address, so if it is the same one you are having problems with then this won't help.


First of all, I thank you and relay appreciate your approach to solve my issue.

I followed your way of adding conf in mod_status.conf . I tried with "allow from 127.0.0.1 localhost", but the browser get redirected to http://localhost/login which display plesk favicon. (Thus with that favicon, i suspect whether the problem is with plesk).
I also tried "allow from 74.XX.XX.XXX " which is my server public ip. but the browser on http://74.xx.xx.xxx/server-status gave "Forbidden- You don't have permission to access /server-status on this server."

I tried similiar configuration on another server which is my test server. both having same plesk engine. and that also gave same issue when access its apache server-status.

The only thing which works is.. when i "On" ExtendedStatus in httpd.conf file and put the rest of SetHandler server-status code in any of domain or sub domain vhost.conf. I can access it from http://test.domain.com/server-status. (As this are Name based virtual hosts point to my server public IP)

Any how, i can work with vhost.conf solution. but my interest is to know why plesk giving 403 with localhost/login.
I have installed phpMyAdmin from http://dev.antoinesolutions.com/phpmyadmin , which created phpMyAdmin.conf in conf.d directory and i can access it from http://localhost/phpMyAdmin , why the problem is when access apache server-status.
I also recheck my root location from all the .htaccess and i dont find anything which resembles with the actual issue.

I thank you for your time to replay.
John.
 
Back
Top