Chapter 26. Modules Included with Apache

 

“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.

Note

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 Modules

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.

mod_access

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.

mod_actions

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.

mod_alias

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.

mod_asis

Name mod_asis
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_asis.html

Sending files that contain their own HTTP headers.

mod_auth

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.

mod_auth_anon

Name mod_auth_anon
On by default? No
Docs http://httpd.apache.org/docs/mod/mod_auth_anon.html

Anonymous user access to authenticated areas.

mod_auth_db

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.

mod_auth_dbm

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.

mod_auth_digest

Name mod_auth_digest
On by default? No
Docs http://httpd.apache.org/docs/mod/mod_auth_digest.html

MD5 digest authentication.

mod_autoindex

Name mod_autoindex
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_autoindex.html

Automatic directory listings.

mod_cern_meta

Name mod_cern_meta
On by default? No
Docs http://httpd.apache.org/docs/mod/mod_cern_meta.html

Support for HTTP header metafiles.

mod_cgi

Name mod_cgi
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_cgi.html

Support for execution of CGI programs.

mod_digest

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.

mod_dir

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.

mod_env

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.

mod_example

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.

mod_expires

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.

mod_headers

Name mod_headers
On by default? No
Docs http://httpd.apache.org/docs/mod/mod_headers.html

Add arbitrary HTTP headers to resources.

mod_imap

Name mod_imap
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_imap.html

Handles server-side image map files.

mod_include

Name mod_include
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_include.html

Server-parsed documents (Server-side includes).

mod_info

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.

mod_log_agent

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.

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.

mod_log_referer

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.

mod_mime

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.

mod_mime_magic

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.

mod_mmap_static

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.

mod_negotiation

Name mod_negotiation
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_negotiation.html

Content negotiation (see Chapter 10).

mod_proxy

Name mod_proxy
On by default? No
Docs http://httpd.apache.org/docs/mod/mod_proxy.html

A caching proxy server.

mod_rewrite

Provides the capability to rewrite incoming URL requests to do all the things that you wish mod_alias did.

mod_setenvif

Name mod_setenvif
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_setenvif.html

Set environment variables based on client information.

mod_so

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.

mod_speling

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]

mod_status

Name mod_status
On by default? Yes
Docs http://httpd.apache.org/docs/mod/mod_status.html

Display server status in a convenient HTML report.

mod_unique_id

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.

mod_usertrack

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.

mod_vhost_alias

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.

Installing or Omitting a Standard Module

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

Apache 2.0

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.

Summary

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  


[1] Yes, the name is mod_speling, not mod_spelling. Someone thinks they're funny.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset