“We shall not cease from exploration And the end of all our exploring Will be to arrive where we started And know the place for the first time.” | ||
--T.S. Eliot |
As we saw in the previous chapter, modules are the heart and soul of why Apache is so great. The Apache core is lightweight and does as little as possible. All the really interesting functionality is implemented in modules.
In this chapter, we talk about the standard modules that ship with Apache. Some of them are not compiled in by default, but can be enabled by a flag at compile time. We'll talk about what each module does, and how to get it installed on your server.
Note that this chapter does not contain comprehensive documentation of these modules. That documentation is available online, in the official Apache module documentation, at http://httpd.apache.org/docs/mod/index.html. More importantly, the official documentation is improved upon on an almost daily basis, therefore printing it here will guarantee that it is almost immediately out of date.
The source code for each of these modules is located in the src/modules
subdirectory when you unpack the Apache distribution file. In particular, these standard modules are in the standard
directory. There is also an experimental
directory containing modules that are not yet considered to be production quality.
You should also note that, as of this writing, Apache 2.0 is in beta, and the list of standard modules is still subject to change. A few of the modules listed here will go away, and some new ones are sure to be added.
The following are the modules that are distributed with Apache. You should note that this is the list of modules that are distributed with Apache only if you download Apache from the official Apache Web site. If you get your Apache distribution from somewhere else, that vendor might have added or removed modules from this list. A number of distributions will add mod_perl
or mod_ssl
to their Apache installation to eliminate the difficulty usually associated with installing those modules.
Name | mod_access
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_access.html |
mod_access
provides access control based on client hostname, IP address, or other characteristics of the client request.
Name | mod_actions
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_actions.html |
Provides for executing CGI scripts based on media type or request method.
Name | Mod_alias
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_alias.html |
Mapping different parts of the file system into the document tree and URL redirection.
Name | mod_asis
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_asis.html |
Name | mod_auth
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_auth.html |
Basic HTTP authentication, using text files to contain user and group information.
Name | mod_auth_anon
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_auth_anon.html |
Name | mod_auth_db
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_auth_db.html |
Basic HTTP authentication, using Berkeley DB files to contain user and group information.
Name | mod_auth_dbm
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_auth_dbm.html |
Basic HTTP authentication, using DBM files to contain user and group information.
Name | mod_auth_digest
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_auth_digest.html |
Name | mod_autoindex
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_autoindex.html |
Name | mod_cern_meta
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_cern_meta.html |
Name | mod_cgi
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_cgi.html |
Name | mod_digest
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_digest.html |
Provides MD5 authentication, but has been replaced by mod_auth_digest
.
Name | mod_dir
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_dir.html |
Provides for mapping URLs with a trailing slash to an index file, typically called index.html
.
Name | mod_env
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_env.html |
Handles the passing of environment variables to CGI programs.
Name | mod_example
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_example.html |
An example module, demonstrating the Apache API, and the technique of writing Apache modules.
Name | mod_expires
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_expires.html |
Gives the capability to apply Expires
: headers to resources.
Name | mod_headers
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_headers.html |
Name | mod_imap
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_imap.html |
Name | mod_include
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_include.html |
Name | mod_info
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_info.html |
Provides the server-info
handler for providing information about server configuration. See Chapter 14, “Handlers and Filters,” for more details.
Name | mod_log_agent
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_log_agent.html |
Logging of user agent (browser). This module is superseded by the LogFormat
directive in mod_log_config
.
Name | mod_log_config
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_log_config.html |
Allows you to build custom log files. See Chapter 24, “Logging,” for detailed discussion of the various logging directives and techniques.
Name | mod_log_referer
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_log_referer.html |
Provides logging of document references. That is, logs the places that have links to your content. This module is superseded by the LogFormat directive in mod_log_config
.
Name | mod_mime
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_mime.html |
Determining document types by file extensions. See Chapter 8 for more discussion of MIME types and the related directives.
Name | mod_mime_magic
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_mime_magic.html |
Determining document types using “magic numbers”—that is, by looking at the contents of the file, and, based on the frequency of occurrence of certain patterns or characters, determining what the file type probably is.
Name | mod_mmap_static
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_mmap_static.html |
Mapping files into memory to improve performance of serving static document. This module is marked as experimental.
Name | mod_negotiation
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_negotiation.html |
Content negotiation (see Chapter 10).
Name | mod_proxy
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_proxy.html |
Name | mod_rewrite
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_rewrite.html and http://apache/httpd-docs-1.3/htdocs/manual/misc/rewriteguide.html
|
Provides the capability to rewrite incoming URL requests to do all the things that you wish mod_alias
did.
Name | mod_setenvif
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_setenvif.html |
Name | mod_so
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_so.html |
Dynamically load modules as shared objects at runtime.
Name | mod_speling
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_speling.html |
Automatically correct minor typos in URLs, such as character transposing, wrong capitalization, or other small errors.[1]
Name | mod_status
|
On by default? | Yes |
Docs | http://httpd.apache.org/docs/mod/mod_status.html |
Name | mod_unique_id
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_unique_id.html |
Generate unique identifiers for each incoming request for tracking purposes.
Name | mod_usertrack
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_usertrack.html |
User tracking using cookies. Make sure you know what you are doing before enabling this. It sends a lot of cookies.
Name | mod_vhost_alias
|
On by default? | No |
Docs | http://httpd.apache.org/docs/mod/mod_vhost_alias.html |
Dynamically configure a large number of virtual hosts without changing your server configuration file.
To install one of the standard modules that is not enabled by default, you need to add an additional parameter during the configuration phase of installation. For example, to add mod_usertrack
to your set of modules, you would use the following command:
./configure —enable-module=usertrack
Note that this argument is in addition to any others that you might already have in effect. This module is added to the list of modules that is already enabled by default. The modules that are already enabled by default need not be mentioned in your configuration options.
Similarly, if you want to disable one of the modules that is enabled by default, you do so with the -disable-module
parameter. For example, if for some reason you wanted to remove mod_auth
from the list of enabled modules, you would use the following command:
./configure —disable-module=auth
The list of standard modules will change some with Apache 2.0. Most importantly, perhaps, SSL will be distributed with Apache by default (it is a separate distribution with Apache 1.3), and will be enabled by default.
The syntax for enabling and disabling modules is somewhat different as well, with a directive for each module. For example, to enable mod_auth_db
, which is not enabled by default, you would use the -enable-auth-db
parameter, as shown in this example:
./configure —enable-auth-db
And, similarly, to disable mod_negotiation
, you would use the -disable-negotiation
parameter:
./configure —disable-negotiation
For a complete list of these possible parameters, you will use the same syntax as with Apache 1.3:
./configure —help
As of this writing, Apache 2.0 is in beta and the list of standard modules is still subject to change.
In summary, here is a list of all the modules that are included with the Apache distribution, and an indication of whether they are enabled by default. This list is possibly subject to change from one release of Apache to the next (although, in practice, it seldom does). You can get the authoritative list for the version that you are using by going to the Apache source code directory and typing ./configure -help
.
access=yes | actions=yes | alias=yes |
asis=yes | auth=yes | auth_anon=no |
auth_db=no | auth_dbm=no | auth_digest=no |
autoindex=yes | cern_meta=no | cgi=yes |
digest=no | dir=yes | env=yes |
example=no | expires=no | headers=no |
imap=yes | include=yes | info=no |
log_agent=no | log_config=yes | log_referer=no |
mime=yes | mime_magic=no | mmap_static=no |
negotiation=yes | proxy=no | rewrite=no |
setenvif=yes | so=no | speling=no |
status=yes | unique_id=no | userdir=yes |
usertrack=no | vhost_alias=no |