Information View Module for Linux System Apache Service Introduction

  

In this article we will discuss using mod_status and mod_info to to tell you what information I can get from the current server operation.

With mod_status, you can see who is watching what is on your server and how many people are connected to the web server. There are other things that your customers may not care about, but it is very useful information for you, a site administrator.

Customers like this information. I don't know what kind of characters your customers are, but my customers like the information I provide. The information once a day is not enough, because it is too late to know until the end of the day. So they like to know what is going on right now.

The two modules mod_info and mod_status provide very useful information and are very convenient.

mod_status can tell you exactly what your server is thinking. You can see who is browsing your site, how many child processes are running, and what are these processes doing.

If you installed Apache using the default method, you should already have mod_status installed. The only thing to do is to add the following lines to the configuration file (httpd.conf) (in fact, just comment it out)

#服务器状态

SetHandler server-status

Order deny,allow

Deny from all

Allow from .your_domain. Com

This SetHandler statement tells Apache that once a matching request is received (in this case, /server-status) it is not looking for the corresponding file, but instead it is handled by the corresponding module or CGI. .

The mod_status module defines a handler (server-status) and an indication section (ExtendedStatus). In the above configuration, when the /server-status resource is accessed, a report of the current activity of the server is provided.

The format is as follows:

W_________.................................. ....................

........................ ..................................

.... .................................................. ..........

................................. ..............................

W stands for a child process that is answering, _ means a child that is idle The process is waiting for incoming connections. Each point represents a potential child process that has not yet been generated. Each potentially allowed service is represented by such a segment.

He also tells you how much time the system has been running since it was last started. If you need more information, you can turn on the ExtendedStatus switch, which is off by default. After turning this switch on, in addition to the above information, you can get a list of each subprocess and its work.

For each child process, you can get its PID, and the CPU time it takes and the time it has been running. For the server, you can get the total number of hits after the server is started, the CPU utilization and the number of hits per minute, and the total number of bytes transferred to the client.

mod_info

mpd-info is a categorized extension. That is to say, he is not integrated into Apache itself, you must increase it manually.

mod_info may not be very useful for customers, but it is very useful for system administrators. Especially if there are many servers that need to be maintained. Use the section below to implement.

SetHandler server-info

Order deny,allow

Deny from all

Allow from .your-domain.com

The revelation of the page display is a list of the things you compiled into Apache and other features that are specific to the server.

If you type: http://your.server/server-info/you can see a list of modules built into the server or a list of modules loaded via DSO.

This is very useful for installing and configuring a specific server. Especially when looking for problems with the wrong configuration file.

Well, the basic introduction of these two modules is here. For detailed information, you still need to think about it yourself. Because it is convenient for customers, it also needs certain security measures. It is necessary to limit the information displayed by these two modules to specific people. Therefore, you need to use Deny, Allow and other statements to restrict access rights.

Copyright © Windows knowledge All Rights Reserved