Learn how to monitor Apache web server load and requests using the mod_status module.
mod_status is an Apache module that provides an HTML interface for monitoring web server load and current HTTP connections. It shows various statistics including:
mod_status is typically enabled by default in Apache. To check or enable it:
Edit Apache Configuration:
[root@tecmint ~]# vi /etc/httpd/conf/httpd.conf
Enable mod_status:
Uncomment or add:
LoadModule status_module modules/mod_status.so
Configure mod_status:
Example configuration:
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from all
Allow from all
</Location>
Enable ExtendedStatus:
In httpd.conf, set:
ExtendedStatus On
Restart Apache:
Check for configuration errors and restart:
[root@tecmint ~]# httpd -t
[root@tecmint ~]# systemctl restart httpd
Access the Apache status page via:
http://serveripaddress/server-statushttp://server-hostname/server-statusAdd ?refresh=5 to the URL for auto-refresh every 5 seconds.
Use command-line browsers like links or lynx:
[root@tecmint ~]# links http://serveripaddress/server-status
# OR
[root@tecmint ~]# lynx http://serveripaddress/server-status
Apache’s mod_status module is a valuable tool for monitoring web server performance and activity. It helps identify issues and optimize server operations.