Q. How do I display Apache server status such as current server activity and performance under Red Hat Enterprise Linux / UNIX / BSD?
A. You can use regular Linux / UNIX commands such as lsof, netstat, top, vmstat and others to view apache server activity, status and performance from a shell prompt. However, I recommend mod_status because it provides good information about Apache server.
mod_status Apache module
There is also mod_status built into Apache web server to get server status from a web browser. With this module you can easily find out how well your server is preforming. All reports are generated in a html format. You can easily find out following type of information:
- Total number of worker serving requests
- Total number of of idle worker
- Find the status of each worker, the number of requests that worker has performed and the total number of bytes served by the worker
- Total number byte count served
- Other information such as CPU usage, number of requests per second,current hosts and requests being processed etc.
How do I configure mod_status to display Apache web server status?
Open your httpd.conf / apache2.conf file:
# vi httpd.conf
Fnd out (append line) that read as follows to allow access from 10.1.2.5 only:
<Location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from 10.1.2.5 </Location>
You can also restrict access using a domain name:
<Location /server-status> SetHandler server-status Order Deny,Allow Deny from all Allow from w1.g2.dc3.helpdesk.nixcraft.com </Location>
Save and close the file. Restart web server, enter:
# service httpd restart
Fire a webbrowser and type the url http://your-server-ip/server-status or http://your-corp.com/server-status
Sample Apache Server Status Report
🐧 16 comments so far... add one ↓
|Category||List of Unix and Linux commands|
|Firewall||Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04|
|Network Utilities||dig • host • ip • nmap|
|OpenVPN||CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04|
|Package Manager||apk • apt|
|Processes Management||bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time|
|Searching||grep • whereis • which|
|User Information||groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w|
|WireGuard VPN||Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04|