Inclusion of modules is done by uncommenting (removing the leading
#
) lines in Configuration.
The only drawback to including more modules is an increase in the
size of your binary and an imperceptible degradation in
performance.[12]
The default Configuration file includes the modules listed here, together with a lot of chat and comment that we have removed for clarity. Modules that are compiled into the Win32 core are marked with “W”; those that are supplied as a standard Win32 DLL are marked “WD.” Our final list is as follows:
Sets up environment variables to be passed to CGI scripts.
Determines logging configuration.
Determines the type of a file.
Maps file extensions to content types.
Allows content selection based on Accept
headers.
Gives access to server status information.
Gives access to configuration information.
Translates server-side include statements in CGI texts.
Indexes directories without an index file.
Handles requests on directories and directory index files.
Executes CGI scripts.
Implements .asis file types.
Executes imagemaps.
Specifies CGI scripts to act as handlers for particular file types.
Corrects common spelling mistakes in requests.
Selects resource directories by username and a common prefix.
Allows Apache to run as a proxy server; should be commented out if not needed.
Provides simple URL translation and redirection.
Rewrites requested URIs using specified rules.
Provides access control.
Provides authorization control.
Provides FTP-style anonymous username/password authentication.
Manages a database of passwords; alternative to mod_auth_dbm.o.
Implements metainformation files compatible with the CERN web server.
Implements HTTP digest authentication; more secure than the others.
Applies Expires
headers to resources.
Sets arbitrary HTTP response headers.
Tracks users by means of cookies. It is not necessary to use cookies.
Generates an ID for each hit. May not work on all systems.
Loads modules at runtime. Experimental.
Sets environment variables based on header fields in the request.
Here are the modules we commented out, and why:
Not relevant here — CERN holdover.
Not relevant here — CERN holdover.
Can’t have both this and mod_auth_db.o. Doesn’t work with Win32.
Only for testing APIs (see Chapter 20).
These are the “standard” Apache modules, approved and supported by the Apache Group as a whole. There are a number of other modules available (see http://modules.apache.org).
Although we mentioned mod_auth_db.o and mod_auth_dbm.o earlier, they provide equivalent functionality and shouldn’t be compiled together.
We have left out any modules described as experimental. Any disparity
between the directives listed in this book and the list obtained by
starting Apache with the -h
flag is probably
caused by the errant directive having moved out of experimental
status since we went to press.
Later on, when we are writing Apache configuration scripts, we can
make them adapt to the modules we include or exclude with the
IfModule
directive. This allows you to give out predefined Config files that
always work (in the sense of Apache loading), regardless of what mix
of modules is actually compiled. Thus, for instance, we can adapt to
the absence of configurable logging with the following:
... <IfModule mod_log_config.c> LogFormat "customers: host %h, logname %l, user %u, time %t, request %r, status %s, bytes %b" </IfModule> ...
[12] Assuming the module has been carefully written, it does very little unless enabled in the httpd.conf files.