Failed to enable server-status. Enable server-status
Recently, apache monitoring for monitoring has always encountered errors. After research, we found that:
Next, we will give a brief introduction to it to prevent future use.
1. What is server-status?
2. How to enable server-status?
Iii. Introduction to server-status
4. How to enable real-time monitoring of server-status?
5. How to Protect server-status?
Vi. FAQs
VII. References
1. What is server-status?
Server-status is a function module for Apache to view the status. It is provided in Apache 1.3.2 and later versions.
2. How to enable server-status?
If Apache configuration files such as httpd. conf or extra/httpd-info.conf have such a statement, you should pay attention to it.
LoadModule status_module modules/mod_status.so
If there is no # comment before this statement, it indicates that the module has been loaded.
If it is on the linux platform, adding-enable-module = so during Apache compilation also indicates that apache supports server-status.
I tested many times directly in the httpd. conf add mod_status.so are all failed, and finally contains/www/apche/conf/extra/httpd-info.conf into httpd. conf, the following statement:
Include /apache/httpd-2.2.22/conf/extra/httpd-info.conf
Use an absolute address to prevent errors.
Enable ExtendedStatus On in/www/apche/conf/extra/httpd-info.conf and remove the previous. Display part:
# Change the ".example.com" to match your domain to enable.<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .xxx.com</Location>## ExtendedStatus controls whether Apache will generate "full" status# information (ExtendedStatus On) or just basic information (ExtendedStatus# Off) when the "server-status" handler is called. The default is Off.#ExtendedStatus On
How to protect security is discussed below.
Iii. Introduction to server-status
If you enable ExtendedStatus On, you can view the IP address and status information of each connection. The status information is described as follows:
_: Waiting for the link.
S: starting.
R: Reading requirement.
W: A response is being sent.
K: Keep online.
D: Looking for DNS.
C: the link is being closed.
L: writing a record file.
G: Enter the normal end program.
I: processing is idle.
..: This program does not exist.
4. How to enable real-time monitoring of server-status?
So easy!
Code Format: server-status? Refresh = N
N takes several seconds to refresh
For example: http://www.xxxxxxxx.com/server-status? Refresh = 10 (Change www.xxxxxxxx.com to your own domain name)
5. How to Protect server-status?
You do not want your server-status to be called by others. So add the protection code:
You can set the default
SetHandler server-status
Order Deny, Allow
Deny from all
Allow from the IP address or domain name you Allow
ExtendedStatus On
Change
SetHandler server-status
Order Deny, Allow
Deny from all
Allow from the IP address or domain name you Allow
ExtendedStatus On
In this way, you need to access it through http: // ip address or domain name/hahaha-server-status.
Brief description:
ExtendedStatus On indicates that detailed request information is displayed during access,
Note: This setting can only be used for global settings. It cannot be enabled or disabled in a specific virtual host.
Enabling the extended status information will reduce the server running efficiency.
Deny from indicates the access prohibited address;
Allow from indicates the allowed access address;
Vi. FAQs
1. The operation above still fails. Why?
You can check whether this module is enabled in httpd-l. If not, compile the module into apache. Write down how to compile later.
VII. References
Http://httpd.apache.org/docs/2.2/mod/mod_status.html