DEV Community

Fega Suseno
Fega Suseno

Posted on • Edited on

Activating Module Status on Apache2

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
Enter fullscreen mode Exit fullscreen mode

Alternatively, you can manually enable it by creating a symlink from mods-available to mods-enabled. 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
Enter fullscreen mode Exit fullscreen mode

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>
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Then reload or restart Apache

systemctl reload apache2
systemctl restart apache2
Enter fullscreen mode Exit fullscreen mode

If you have a firewall enabled, open access on HTTP and HTTPS ports

ufw allow http
ufw allow https
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay