Tag: Compile and install Apache
./configure--prefix=/application/apache.2.2.27/\//Installation location specified when installing
--enable-deflate \//Compress the transfer file
--enable-expires \//Browser cache
--enable-headers \//Activating HTTP Headers
--enable-modules=most \//Loading Apache module
--ENABLE-SO \
--with-mpm=worker \//Select Apache's operating mode (supports high concurrency worker)
--enable-rewrite//pseudo-static
Apache has three modes of operation:
1, Prefork MPM;
2, the worker MPM;
3, Perchild MPM.
prefork MPM
The administrator should choose Prefork MPM to implement a process-based Web server. Although process-based servers have some slow performance, they provide stability and compatibility through the modules that do not support threading. To improve performance, the server's parent process fork multiple sub-processes and enables them to be used to answer requests. When a request is received, the server assigns it to the sub-process. If no sub-processes are available, the server creates a new sub-process and adds it to the library. However, the creation of sub-processes can cause delays. When configuring this MPM, the administrator can limit the number of sub-processes that can be created at startup, the maximum number of sub-processes, and so on. This MPM facilitates the formation of a stable Apache server, but at the same time affects performance and memory consumption because the size of a single process is a large part.
the worker MPM
To implement a hybrid server, administrators can choose the worker MPM, which provides superior reliability, resiliency, and scalability over Prefork MPM. At startup, the parent process creates a specified number of sub-processes, which in turn contain multiple threads per sub-process. Only one thread in each sub-process listens to the network, simplifying program code and reducing collaboration between processes to improve performance. While this MPM is stable and performance is better than prefork, because it is thread-based, all modules used with it must be fully thread-safe. Most Apache 1.3 modules are not thread-safe, and because the worker mpm is not backwards compatible, administrators using this MPM cannot use the Apache 1.3 module together with Apache 2.0. However, using prefork MPM to compile the server allows administrators to use the Apache 1.3 module.
The Perchild MPM
If you encounter a situation in which the Apache process needs to be run based on a different user ID, given security and performance, the administrator can use Perchild MPM to compile the hybrid server. Internet Service providers (ISPs) typically use this MPM for virtual hosting. When Perchild is started, it creates a defined number of processes, each with a defined number of threads and a dedicated user ID. If the load on the server increases, it uses one of the existing processes to create a new thread instead of creating a new process. This MPM is the most extensible, but also the most unreliable.
Compile and install Apache