Mod\_status is an Apache module that helps server administrators get insights into the performance and activity of Apache web server.
Before you start configuring mod\_status, you must ensure that it is enabled in your Apache installation.
Step to configure mod\_status module:
1. Open your Apache configuration file in a text editor. The location of this file can vary depending on your system, some common locations include /etc/httpd/httpd.conf, /etc/apache2/apache2.conf, or /etc/apache2/sites-enabled/000-default.conf.
1. To activate the mod\_status module, you need to include the following lines:
```
LoadModule status_module modules/mod_status.so
ExtendedStatus On
```
The “LoadModule” directive tells Apache to load the mod\_status module, and “ExtendedStatus On” enables additional status details.
1. Next, you need to specify the location from where server stats can be accessed. You can use a code block like the following to enable the /server-status location:
```
```
In the above configuration, server status can only be viewed from the server where Apache is running, If you want to access it from other IP, you can add them.
1. Save your configuration file and exit the text editor.
1. Lastly, you need to restart your Apache server to apply the changes. This can typically be done with one of the following commands:
```
sudo systemctl restart apache2 // On systemd-based systems such as Ubuntu and Debian
sudo systemctl restart httpd // On sysvinit-based systems such as CentOS and RHEL
```
Now you can view the server status by navigating to http://yourserver.com/server-status.
For more detailed information, you can append ?auto to the URL (i.e., http://yourserver.com/server-status?auto).
Note: Always be sure to secure access to this data, as it can provide potentially sensitive information about your server.