Question
How to enable the Apache server statistics on a Plesk server?
Answer
-
Connect to the Plesk server via SSH.
-
Check if "status_module" is loaded:
-
for CentOS/RHEL-based distributions:
# httpd -M | grep status
status_module (shared) -
for Debian/Ubuntu-based distributions:
# apache2ctl -M | grep status
status_module (shared)If the output is empty, enable the "status" module in Plesk at Tools & Settings > Apache Web Server.
-
-
Find out Apache version:
-
for CentOS/RHEL-based distributions:
# httpd -v | grep version
-
for Debian/Ubuntu-based distributions:
# apache2 -v | grep version
-
-
To make status reports visible to your IP address (from which you access this page in a browser), add the below code to the Apache configuration file (create a new file, if there is no):
-
CentOS/RHEL-based distributions:
CentOS 7:
/etc/httpd/conf.modules.d/status.conf
CentOS 6:/etc/httpd/conf.d/status.conf
-
Debian/Ubuntu-based distributions:
/etc/apache2/mods-enabled/status.conf
In this example, we are allowing status reports to IP addresses 203.0.113.2 and 203.0.113.3:
-
for Apache 2.2:
<IfModule mod_status.c>
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 203.0.113.2 203.0.113.3
</Location>
ExtendedStatus On
</IfModule> -
for Apache 2.4:
<IfModule mod_status.c>
<Location /server-status>
SetHandler server-status
<RequireAny>
Require ip 203.0.113.2 203.0.113.3
</RequireAny>
</Location>
ExtendedStatus On
</IfModule>
-
-
-
Restart Apache web-server:
-
for CentOS/RHEL-based distributions:
# service httpd restart
-
for Debian/Ubuntu-based distributions:
# service apache2 restart
Server statistics will now be available at http://your.server.ip.address/server-status
Warning: Apache server statistics page can contain sensitive information. For security reasons, we recommend to enable authentication/authorization (e.g. HTTP basic authentication) for this URL.
-