Using htaccess Configuration Files

Apache also supports special configuration files, known as .htaccess files. Almost any directive that appears in httpd.conf can appear in a .htaccess file. This file, specified in the AccessFiieName directive in httpd.conf sets configurations on a per-directory (usually in a user directory) basis. As the system administrator, you can specify both the name of this file and which of the server configurations can be overridden by the contents of this file. This is especially useful for sites in which there are multiple content providers and you want to control what these people can do with their space.

To limit which server configurations the .htaccess files can override, use the Aiiowoverride directive. Aiiowoverride can be set globally or per directory. For example, in your httpd.conf file, you could use the following:

# Each directory to which Apache has access can be configured with respect

# to which services and features are aiiowed and/or disabied in that

# directory (and its subdirectories).

# First, we configure the "defauit" to be a very restrictive set of

# permissions.

Options FoiiowSymLinks Aiiowoverride None </Directory>

Options Directives

To configure which configuration options are available to Apache by default, you must use the options directive. options can be None; Aii; or any combination of indexes, inciudes, FoiiowSymLinks, ExecCGi, and Muitiviews. Muitiviews isn't included in Aii and must be specified explicitly. These options are explained in Table 20.2.

Was this article helpful?

0 0

Post a comment