The Apache server HTTPD configuration file has a number of modules that can be called, including the following modules:
# LoadModule foo_module modules/mod_foo.so
LoadModule access_module modules/mod_access.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule headers_module modules/mod_headers.so
LoadModule imap_module modules/mod_imap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule ssl_module modules/mod_ssl.so
The code preceded by “#” indicates that the code is not commented to take effect. If this code needs to take effect, you need to cancel the “#” in front of it. To monitor Apache status, start the LoadModule status_module modules/mod_status.so module.
After the Apache server status management module (LoadModule status_module modules/mod_status.so) is started, only the following basic information is displayed by default, as shown in the following figure.
To display all status information, you need to set ExtendedStatus to On. The default value of ExtendedStatus is Off. In normal cases, only the basic information shown in Figure 10-1 can be displayed. The server status information is called by “handler” in the usual “server-status”. The code of the “server-status” is as follows:
<Location /server-status>
SetHandler server-status
Order deny,allow
# Deny from all
Allow from all
</Location>
Deny from: indicates that the access address is denied.
Allow from: indicates the allowed address access.
Note: The “server-status” module must be started before monitoring. Otherwise, The SetHandler cannot read the status information of the server, which leads to monitoring failure.
Enter the URL (http://IP/server-status) to check whether the Apache server status information is displayed correctly. If yes, the details shown in the figure are displayed.
There are two more parameters for displaying the detailed state:
? Refresh =N: Set the detailed information to be dynamically refreshed every N seconds. Refresh =5 means refresh every 5 seconds), if no specific interval is set (for example? Refresh), then the default is to dynamically refresh details every 1 second.
? Auto: indicates the dynamic information when the server is in the access state.
Such as http://localhost/server-status? Auto&refresh =5 Indicates that details are dynamically refreshed every 5 seconds, as shown in the figure.
Total Accesses: the number of connections and data transfers that are currently connected to Apache;
To kBytes: Total number of bytes received;
Uptime: indicates the total running time of the server (in seconds).
ReqPerSec: average number of requests per second;
BytesPerSec: The average number of bytes sent per second;
BytesPerReq: Average number of bytes sent per request;
BusyWorkers: number of working workers;
IdleWorkers: number of idle jobs;
The number of BusyWorkers plus IdleWorkers and the number of threads allowed to work at the same time for the service. The maximum number of threads allowed at the same time in the configuration file is ThreadsPerChild, whose missing value is 250. Namely ThreadsPerChild = BusyWorkers + IdleWorkers.
If you enter http://IP/server-status, only related statistics information is displayed instead of dynamic information. The following information is displayed:
Apache Server Status for localhost
Server Version: Apache/2.0.59 (Win32) mod_SSL /2.0.59 OpenSSL/0.9.8e PHP/5.2.5
Server Built: Jul 21 2006 08:48:52
Current Time: Thursday, 29-Nov-2012 19:41:08 GMT
Restart Time: Thursday, 29-Nov-2012 18:53:47
Parent Server Generation: 0
Server uptime: 47 minutes 21 seconds
Total accesses: 626 – Total Traffic: 1.3 MB
.22 requests/sec – 468 B/second – 2124 B/request
1 requests currently being processed, 249 idle workers
________________________________________________________________
________________________________________________________________
________________________________________________________________
_________________________________________________________W……
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
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
The meanings of statistics are as follows: Number of connections received by Apache so far and amount of data transferred, total number of bytes sent, average number of requests per second, average number of bytes sent per second, average number of bytes sent per request, number of threads currently being requested, and number of idle connections.
The state of M column mainly includes the following:
_ : Waiting for a link.
S: Starting.
R: Reading the request.
W: Sending a response.
K: Is in the online state.
D: The DNS is being searched.
C: Closing the link.
L: Writing to a record file.
G: Enter the normal termination procedure.
I: Processing idle.
: No such procedure exists.
See table for the meaning of the columns in the request form.