Apache Basics, Visited [con't]
|
Learn Apache’s Multi-Processing Modules (MPMs)
The Apache HTTP Server is designed to work on a wide variety of platforms in a range of different environments. This design allows the webmaster to choose which features will be included in the server by selecting which modules to load either at compile-time or at run-time.
Apache 2.0 extends this modular design to the most basic functions of a Web server. The server ships with a selection of Multi-Processing Modules (MPMs) which are responsible for binding to network ports on the machine, accepting requests, and dispatching child processes to handle the user requests.
In particular, the Windows version of Apache is much more efficient, since mpm_winnt can use native networking features in place of the POSIX layer used in Apache 1.3. This benefit also extends to other operating systems that implement specialized MPMs.
The server can be better customized for the needs of a particular site. For example, sites that need a great deal of scalability can choose to use a threaded MPM-like worker, while sites requiring stability or compatibility with older software can use a prefork. In addition, special features like serving different hosts under different userids (per child) can be provided.
At the user level, MPMs appear much like other Apache modules. The main difference is that one and only one MPM can be loaded into the server at any given time.
Include the WinNT (Windows) MPM with default settings
The below example of the settings with your https.conf file is a common one that you’ll run into on a regular basis on a Windows platform. Examine the following:
First we declared the IfModule core directive. We then specified the ThreadsPerChild directive. Next we specified MaxRequestsPerChild and finally closed the IfModule directive.
Note: ThreadsPerChild is the constant number of worker threads in the server process. MaxRequestsPerChild is the maximum number of requests a server process serves.
If you were to learn the C language, you can have some very intriguing features added to your Internet creation. An MPM for media delivery or for more advanced features such as access control and customized Web page controls can be used to jazz up your site, adding a unique twist to your Internet creation’s offering.
Since httpd.conf, the main configuration file for Apache, can be customized to suit your use, you may add modules to the server configuration that contain these higher functions and features. I’ve encountered modules that deliver an audio and video stream to the browser, for example. These higher features are just a click away for some sites, and they invariably get good ratings and hit counts.
Some sites that require more flexibility, control, and features use modules to deliver custom controls to the browser for applications such as streaming financial data and other data intensive applications. The use of a module to deliver this functionality isn’t restricted to financial sites – you may stream any data you have provided for to the browser, enhancing your user’s experience.
So that’s a brief look at Apache. For a full and exhaustive discussion of Apache, read the entire Apache manual that comes with both the source and binary distributions of Apache. Until then, I wish you the best with your Apache installation.
Original: January 26, 2009
![]()




