Difference between revisions of "Enable Server Status"

From Wiki
Jump to: navigation, search
 
Line 1: Line 1:
{{Box Note|
+
Update the mod_status.conf file to allow access to server-status from your network.
Update httpd.conf to allow access to server-status from your network. /usr/local/apache/conf/includes/pre_virtualhost_global.conf may be better on cPanel servers.
+
}}
+
  
 
<pre>
 
<pre>
Line 8: Line 6:
 
Order Deny,Allow
 
Order Deny,Allow
 
Deny from all
 
Deny from all
Allow from 127.0.0.1 ::1 10.20.4.0/24
+
Allow from 127.0.0.1 ::1 192.168.0.0/24
 
</Location>
 
</Location>
 
</pre>
 
</pre>
  
Servers using mod_security will also need the rules adjusted to allow server-status to work.  Run vim and comment out the rules as below.
+
After making changes test the configuration and restart apache.
 
+
vim +692 /usr/local/apache/conf/modsec2.user.conf
+
 
+
<pre>
+
#Apache /server-info accessible
+
#SecRule REQUEST_URI  "/server-info" "chain,id:2000237"
+
#SecRule REMOTE_ADDR "!^127\.0\.0\.1$"
+
 
+
#Apache /server-status accessible
+
#Modified so apache-protect can run
+
#SecRule REQUEST_URI "^/server-status/$" "chain,id:2000238"
+
#SecRule REMOTE_ADDR "!^127\.0\.0\.1$"
+
</pre>
+
 
+
After making your changes test the configuration and restart apache.
+
  
 
  httpd -t
 
  httpd -t
 
  systemctl restart httpd
 
  systemctl restart httpd

Latest revision as of 17:18, 15 January 2019

Update the mod_status.conf file to allow access to server-status from your network.

<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 ::1 192.168.0.0/24
</Location>

After making changes test the configuration and restart apache.

httpd -t
systemctl restart httpd