Apache status configuration and how to view apache-status

People are often troubled by the apache process occupying too many server resources, and the apache logs are numerous and complex, and it is difficult for ordinary administrators to see the results from the logs. If you are using Apache 1.3.2 and later version, at this time a good tool of apache can solve your troubles, that is the function that comes with apache----server-status.
   How can I open the server-status of apache?
   First you have to compile a module of apache, you can check if there is LoadModule status_module modules/mod_status.so in your configuration file (httpd.conf), if so, it means your apache has loaded this module. Or you add --enable-module=so when compiling, which also means that the server supports it. In fact, the best way is to follow the steps below to open server-status first to see if it can be used. If there is no such module how to add it?
   If this module is not loaded, if you are a linux server, then you need to recompile apache, add the parameter --enable-module=so when compiling, if you are a windows system, you don't need any compilation, just put The sentence LoadModule status_module modules/mod_status.so mentioned just now is added. If there is a # sign in front of it, if it is turned on, you need to remove the #.
   After confirming that your system has this module, the following work is to configure server-status! 

CODE:

<Location /server-status>
         SetHandler server-status
         Order Deny,Allow
         Deny from all
         Allow from .foo.com
   </Location>

   ExtendedStatus On This is a complete server-status configuration
   deny means forbidden, if you don't want to use it , can be set to the above settings, if it is fully enabled, this line can be deleted as a whole, allow from means that you can access through that address, if you are using it, you can set it to allow from all, and the last sentence means that you can access it later Time to see the detailed request information!
If apache has configured a reverse proxy, you must cancel the proxy to the /server-status path in the reverse proxy of port 80. The specific code is as follows:
ProxyPass /server-status !

   Now you can access server-status through url, http://ip address/server-status, you can change the access path by changing the server-status in < Location /server-status>, for example, it should be <Location /discuz -status>, so you can go through http://ip-address/discuz-status. The above ip address is related to your Allow from setting. If you set it to a domain name that points to your ip, you can access it through
http://domain name/discuz-status!
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326541421&siteId=291194637