with both of these commands; for example, mod_version.so is the
filename, but version is the name of the module. You have to know the
name of the module to use either command, but in most cases, it is as simple
as the difference in this example. Also, after you run either command, you
need to restart apache2 to activate the new configuration.
mod_access
mod_access controls access to areas on your web server based on IP
addresses, hostnames, or environment variables. For example, you might want
to allow anyone from within your own domain to access certain areas of your
website. See the “File System Authentication and Access Control” section,
earlier in this chapter, for more information.
mod_alias
mod_alias manipulates the URLs of incoming HTTP requests, such as
redirecting a client request to another URL. It also can map a part of the file
system into your web hierarchy. For example, the following fetches contents
from the /home/wsb/graphics directory for any URL that starts with
/images/:
Click here to view code image
Alias /images/ /home/wsb/graphics/
This is done without the client knowing anything about it. If you use a
redirection, the client is instructed to go to another URL to find the requested
content. You can accomplish more advanced URL manipulation with
mod_rewrite, discussed later in this chapter.
mod_asis
mod_asis is used to specify, in fine detail, all the information to be included
in a response. This completely bypasses any headers Apache might have
otherwise added to the response. All files with an .asis extension are sent
straight to the client, without any changes.
As a short example of the use of mod_asis, assume that you’ve moved
content from one location to another on your site. Now you must inform
people who try to access this resource that it has moved, and you also need to
automatically redirect them to the new location. To provide this information