New Features in Apache v2
The procedure for configuring and compiling Apache has changed, as we will see later.
High-level decisions about the way Apache works internally can now be
made at compile time by including one of a series of Multi Processing
Modules (MPMs). This is done by attaching a flag to
configure
:
./configure <other flags> --with_mpm=<name of MPM>
Although MPMs are rather like ordinary modules, only one can be used at a time. Some of them are designed to adapt Apache to different operating systems; others offer a range of different optimizations for Unix.
It will be shown, along with the other compiled-in modules, by
executing httpd -l.
When we went to press,
these were the possible MPMs under Unix:
- prefork
Default. Most closely imitates behavior of v1.3. Currently the default for Unix and sites that require stability, though we hope that threading will become the default later on.
- threaded
Suitable for sites that require the benefits brought by threading, particularly reduced memory footprint and improved interthread communications. But see “prefork” earlier in this list.
- perchild
Allows different hosts to have different user IDs.
- mpmt_pthread
Similar to prefork, but each child process has a specified number of threads. It is possible to specify a minimum and maximum number of idle threads.
- Dexter
Multiprocess, multithreaded MPM that allows you to specify a static number of processes.
- Perchild
Similar to Dexter, but you can define a seperate user and group for each child process to increase server security.
Other operating systems have their own MPMs:
- spmt_os2
For OS2.
- beos
For the Be OS.
- WinNT
Win32-specific version, taking advantage of completion ports and native function calls to give better network performance.
To begin with, accept the default MPM. More advanced users should refer to http://httpd.apache.org/docs-2.0/mpm.html and http://httpd.apache.org/docs-2.0/misc/perf-tuning.html.
See the entry for the AcceptMutex directive in Chapter 3.
Get Apache: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.