Symptoms
Apache Status is displaying "Failed to receive status information from Apache."
Cause
In cPanel v136, the whm-server-status endpoint was obfuscated for security purposes, and WHM now expects this obfuscated URL. If you are using a custom Apache template created before the update, or trying to access the old url with a third party tool, it will generate an error instead.
Resolution
Create a new template to reference the obfuscated URL, or a template to use the old static URL.
- Access the server as the
rootuser via SSH or the Terminal in WHM. -
Open the local Apache template file with your preferred text editor:
# vi /var/cpanel/templates/apache2_4/ea4_main.local
CPANEL_INFO: If you do not yet have a local template file, use the instructions here to create one:
How can I customize the Apache Virtual Host templates? - In this file, locate the section regarding the
status_module. -
Update this module's section to the following:
CONFIG_TEXT: <IfModule status_module>
# This is used by the WHM 'Apache Status' application
[% IF whm_server_status_key -%]
<Location /[% whm_server_status_key %]>
[% ELSE -%]
<Location /whm-server-status>
[% END -%]
SetHandler server-status
Order deny,allow
Deny from all
[% IF options_support.APR_HAVE_IPV6 -%]
Allow from 127.0.0.1 ::1
[% ELSE -%]
Allow from 127.0.0.1
[% END -%]
<IfModule security2_module>
SecRuleEngine Off
</IfModule>
<IfModule security3_module>
modsecurity_rules 'SecRuleEngine Off'
</IfModule>
</Location>
[% IF serve_server_status -%]
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from [% allow_server_info_status_from %]
</Location>
[% END -%]
</IfModule> -
Rebuild and restart Apache:
# /scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
CPANEL_WARN: Using the old static URL is not recommended. Please use the obfuscated secure URL unless you have a specific requirement for the old static URL.
- Access the server as the
rootuser via SSH or the Terminal in WHM. -
Open the local Apache template file with your preferred text editor:
# vi /var/cpanel/templates/apache2_4/ea4_main.local
CPANEL_INFO: If you do not yet have a local template file, use the instructions here to create one:
How can I customize the Apache Virtual Host templates? - In this file, locate the section regarding the
status_module. -
Update this module's section to the following:
CONFIG_TEXT: <IfModule status_module>
# This is used by the WHM 'Apache Status' application
<Location /whm-server-status>
SetHandler server-status
Order deny,allow
Deny from all
[% IF options_support.APR_HAVE_IPV6 -%]
Allow from 127.0.0.1 ::1
[% ELSE -%]
Allow from 127.0.0.1
[% END -%]
<IfModule security2_module>
SecRuleEngine Off
</IfModule>
<IfModule security3_module>
modsecurity_rules 'SecRuleEngine Off'
</IfModule>
</Location>
[% IF serve_server_status -%]
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from [% allow_server_info_status_from %]
</Location>
[% END -%]
</IfModule> -
Rebuild and restart Apache:
# /scripts/rebuildhttpdconf && /scripts/restartsrv_httpd
Comments
0 comments
Article is closed for comments.