LINUX APACHE Server Configuration Raiders (2)

zhaozj2021-02-11  230

LINUX APACHE Server Configuration Raiders (2)

Author: Bo OSO Oso

MinSpareServers 5MaxSpareServers 10

On the WEB server that uses sub-process to process HTTP requests, the response time is a little delay because of the first generation of a child process to handle the client. However, the Apache server uses a special technique to get rid of this problem. This is the pre-generic sub-process resident in the system. Once there is a request, it will immediately use these empty child processes to handle it, so there is no existence The latency caused by the generated sub-process. In operation, as the customer request increases, the started child process will increase, but these server copies do not quit immediately after processing the HTTP request, but stay in the computer waiting for the next request. However, the sub-process copy of the sub-process cannot be increased, too much, there is no treatment of the task, and the server's processing power is also occupied, so it is necessary to limit the number of empty copies, so that it can always be in time Responding to the customer request and reduces the number of unnecessary processes.

Therefore, you can use the parameter minSpareServers to set the minimum amount of the air conditioner process, and

Use parameter maxSpareServers to limit the number of idle child processes, excess server process copies will exit. Set according to the actual situation of the server, if the server performance is high, and also

Access is frequent, you should increase the settings of these two parameters. For high-load professional websites, these two values

Should be substantially the same, and equivalent to the number of larger server copies supported by the system, also reduces unnecessary deputy

This exit.

StartServers 5

The startservers parameter is used to set the number of sub-process replica initiated when HTTPD startup. This parameter is related to the MINSPARSERVERSERSERSERSERVERSERS parameter defined above, which is used to initiate an idle child process to improve the speed of the server. This parameter should be set to a value between the first two values, less than MINSPARSERVERS and greater than MaxS Preservers.

MaxClients 150

On the other hand, the server's ability is limited, it is impossible to handle unlimited connections.

Seeking, the parameter MaxClient S is used to specify the number of customers supported by the server support. If this value is set too large, the system has to cut between too many processes when busy. This will slow down to each customer, and reduce the overall efficiency. If this value is set, it will reject some client connection requests when the system is busy. When the server performance is high, the setting of this value can be appropriately added. For professional websites, it should be used to improve server efficiency, so this parameter cannot exceed the hardware itself, if there is a refusal access phenomenon, you need to upgrade the server hardware. For non-professional websites, it is not very concerned with the reaction speed of the customer browser, or that the reaction speed is slower than the rejection, it can also be slightly over the hardware condition to set this parameter.

This parameter limits the settings for MinSpareServers and MaxSpareServers, which should not be large.

Setting this parameter.

MaxRequestSperchild 30

The use of sub-processes provide services for web services. The common way is a child process as a connection service. The problem caused by generating, exiting the child process is required each time, making these additional processing processes occupying A large amount of processing capabilities of the computer. So the best way is that a child process can be a multiple connection request service, so it does not require these generations, and the system consumption of the process, Apache uses this way, after the connection is completed, the child process does not quit, and It is a stay in the system to wait for the next service request, which greatly improves performance. However, due to the constant application and release of memory during processing, it will cause one more.

Some memory garbage will affect the stability of the system and affect the effective use of system resources. Therefore, after a copy of a copy is handled, the copy copy can be exited, then from the original

A clean copy is re-replicated in the HTTPD process so that the stability of the system can be improved. In this way, each

The number of sub-process processing service requests is defined by Maxre QuestperChild. The default set value is 30,

This value is too conservative for the Linux system with high stability characteristics, which can be set to 1000 or even higher, set to 0 to support each copy to perform unlimited service processing.

#Listen 3000

#Listen 12.34.56.78:80

#Bindaddress *

The Listen parameter can specify that the server has monitored other ports in addition to the 80-port of monitoring standards.

HTTP request. Since the FreeBSD system can have multiple IP addresses simultaneously, you can also specify that the server only listened to the HTTP request for the IP address of a BindAddress . If this is not configured, the server will respond to requests for all IPs.

Even if the BindAddress parameter is used, the server only responds to a request to an IP address, but by using the extended Listen parameter, the HTTP daemon can still respond to the request for other IP addresses. The usage of the Listen parameter is the same as the second example above. This more complex usage is mainly used to set the virtual host. Thereafter, you can define a virtual host for different IPs, but this usage is a method of setting a virtual host in an earlier HTTP 1.0 standard. Each time a virtual host requires an IP address, it is actually not large. In HTTP 1.1, support for virtual hosts of a single IP address multi-domain name have increased, making the settings of the virtual host have greater meaning.

LOADMODULE MIME_MAGIC_MODULE LIBEXEC / APACHE / MOD_MIME_MAGIC.SO

LoadModule Info_Module Libexec / Apache / MOD_INFO.SO

LoadModule Speling_Module Libexec / Apache / MOD_SPELING.SO

LoadModule Proxy_Module Libexec / Apache / LibProxy.so

LoadModule Rewrite_Module Libexec / Apache / MOD_rewrite.so

LOADMODULE Anon_AUTH_MODULE LIBEXEC / APACHE / MOD_AUTH_ANON.SO

LOADMODULE DB_AUTH_MODULE LIBEXEC / APACHE / MOD_AUTH_DB.SO

LoadModule Digest_Module Libexec / Apache / MOD_Digest.so

LOADMODULE CERN_META_MODULE LIBEXEC / APACHE / MOD_CERN_META.SO

LoadModule Expires_Module Libexec / Apache / MOD_EXPIRES.SOSOSOSO

LoadModule Headers_Module Libexec / Apache / MOD_HEADERS.SOLOADMODULE Utertrack_Module Libexec / Apache / MOD_USERTRACK.SOSOSO

LOADMODULE UNIQUE_ID_MODULE LIBEXEC / APACHE / MOD_UNIQUE_ID.SO

ClearModuleList

AddModule MOD_ENV.C

AddModule MOD_LOG_CONFIG.C

AddModule MOD_MIME_MAGIC.C

AddModule MOD_MIME.C

AddModule MOD_NEGOTIATION.C

AddModule MOD_STATUS.C

AddModule MOD_INFO.C

AddModule MOD_INCLUDE.C

AddModule MOD_AUTOINDEX.C

AddModule MOD_DIR.C

AddModule MOD_CGI.C

AddModule MOD_ASIS.C

Addmodule MOD_IMAP.C

AddModule MOD_ACTIONS.C

Addmodule MOD_SPELING.C

AddModule MOD_USERDIR.C

AddModule MOD_PROXY.C

AddModule MOD_ALIAS.C

AddModule MOD_REWRITE.C

AddModule MOD_ACCESS.C

AddModule MOD_AUTH.C

AddModule MOD_AUTH_ANON.C

AddModule MOD_AUTH_DB.C

AddModule MOD_Digest.c

AddModule MOD_CERN_META.C

AddModule MOD_EXPIRES.C

AddModule MOD_HEADERS.C

AddModule MOD_USERTRACK.C

AddModule MOD_UNIQUE_ID.C

AddModule MOD_SO.C

AddModule MOD_SETENVIF.C

An important feature of the Apache server is its modular structure, which is not only manifested.

Translate can join new features through the new module, but also behave as its module to be dynamically loaded into the HTTP service

In the order, there is no need to load unwanted modules. Using Apache's dynamic loading module only needs to set the load module and addModule parameters, this feature is the "Dynamic Shared Object" feature, but to fully use the DSO characteristic is still not a simple thing, inappropriate Change the settings here that the server may not start normally. So if it is not to increase or reduce the functionality provided by the server, do not change the settings here.

The above list shows the modules supported by the default Apache server under Linux, in fact

Multi-block is not necessary, unnecessary modules will not be loaded into memory. The module can be staticly connected to the inside of the Pache server, or to dynamically load, compile Apache's characteristics into dynamic loadless modules, rather than Apache's default, while sacrificing small performance It brings great flexibility.

Thus, the dynamic loadable ability is a slight effect on performance, so it can recompile Apache to compile the features you need to the Apache server, allowing the system to be more clean and efficient. Usually recompile Apache only if this purpose is not necessary. If you need to add additional features and recompile Apache, you may wish to connect all modules in the Apache server while adding other modules. Some users prefer to dynamically load modules, so they may wish to use dynamic loading modules.

These modules are placed in / usr / local / apache / libexec / directory, each module corresponding to a characteristic of the Apache server. Detailed explanation of each module requires considerable space, which is more important to explain in the corresponding place, and the functionality and usage of each module need to view the Apache documentation.

#ExtendedStatus on

Apache server can report its own running status through a special HTTP request, open this

The extendedStatus parameter allows the server to report more fully run status information.

>> Previous article: Linux Apache Server Configuration Raiders (1) >> Next article: Linux Apache Server Configuration Raiders (3)

转载请注明原文地址:https://www.9cbs.com/read-3645.html

New Post(0)