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

(Fig.01: Apache mod_status module in action)
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 7 comments… read them below or add one }
Hi,
An undocumented or obscurely documented feature,
appending “?notable” to the status url, like;
http://your-server-ip/server-status?notable
gives you a different output.
I get an error when I run this command /usr/sbin/apachectl status
here is the error:
Unfortunately, your browser is not supported by Sitebuilder.
Please use Internet Explorer 5.5 or later, or Mozilla.
on my redhat server running apache2 not giving proper report.. it was running fine last week. suddenly stop now..
please help me out..?
Current Time: Saturday, 06-Sep-2008 11:22:28 EST
Restart Time: Saturday, 06-Sep-2008 11:09:25 EST
Parent Server Generation: 1
Server uptime: 13 minutes 2 seconds
9 requests currently being processed, 17 idle workers
____WW_.__.W.W__K.W_____.__WK.K_…………………………..
……………………………………………………….
……………………………………………………….
……………………………………………………….
……………………………………………………….
……………………………………………………….
……………………………………………………….
……………………………………………………….
Scoreboard Key:
“_” Waiting for Connection, “S” Starting up, “R” Reading Request,
“W” Sending Reply, “K” Keepalive (read), “D” DNS Lookup,
“C” Closing connection, “L” Logging, “G” Gracefully finishing,
“I” Idle cleanup of worker, “.” Open slot with no current process
PID Key:
25963 in state: _ , 25964 in state: _ , 25965 in state: _
25966 in state: _ , 25967 in state: W , 25968 in state: W
25969 in state: _ , 25971 in state: _ , 25972 in state: _
25974 in state: W , 25976 in state: W , 25977 in state: _
25978 in state: _ , 25979 in state: K , 25981 in state: W
25982 in state: _ , 25983 in state: _ , 26248 in state: _
26250 in state: _ , 26251 in state: _ , 26336 in state: _
26337 in state: _ , 26338 in state: W , 26339 in state: K
26343 in state: K , 26344 in state: _ ,
——————————————————————————–
To obtain a full report with current status information you need to use the ExtendedStatus On directive.
i did the change in httpd.conf and restarted. But getting
Forbidden
You don’t have permission to access /server-status on this server.
How to fix that? Please guide me.
Any help greatly appreciated
I have server-status working fine using http:/servername/server-status
How can I output this to a text file?
You can use wget command to output to a file, try :
/usr/bin/wget –quiet -O – “http:/servername/server-status” > Output.txt
[wget ... -O - ... > Output.txt] ??
Whats wrong with:
[wget ... -O Output.txt ... ] ?