In this post, we will discuss mod_status
in Apache2. This module provides detailed status information about the running Apache web server. It allows us to view runtime statistics, such as resource usage, the number of requests being processed, and various metrics related to server performance and status.
Let’s dive straight into the configuration. For this lab, I used Ubuntu 24.04 LTS. Let's get started!
To activate mod_status
, use the following command:
a2enmod status
Alternatively, you can manually enable it by creating a symlink from mods-available
to mods-enable
d. This method has been discussed in this post
Once activated, edit the status.conf
file in mods-enabled
nano /etc/apache2/mods-available/status.conf
Modify its contents as follows
<IfModule mod_status.c>
<Location /server-status>
SetHandler server-status
+ Require all granted
#Require ip 10.0.0.0/21
</Location>
# Keep track of extended status information for each requ>
ExtendedStatus On
<IfModule mod_proxy.c>
# Show Proxy LoadBalancer status in mod_status
ProxyStatus On
</IfModule>
</IfModule>
The line highlighted in green is the one to pay attention to. By default, it is set to Require local. You can specify an IP address
or subnet
to allow specific access, use all granted
to permit access to everyone, or comment it out with #
to achieve the same effect.
Next, verify if the configuration is correct
apachectl configtest
Then reload or restart Apache
systemctl reload apache2
systemctl restart apache2
If you have a firewall enabled, open access on HTTP and HTTPS ports
ufw allow http
ufw allow https
Test the configuration by accessing the Apache web server's IP address
http://ip-server/server-status
If it still doesn’t work, check the logs for further troubleshooting
tail -f /var/log/apache2/error.log
If you’re still unable to access the status page, ensure that the
mod_proxy
module is enabled by running
Good luck! I hope you find this useful
Top comments (0)