configuring.xml revision f629fd8f821ed20d16d76733bc19bf5480986220
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen<?xml version='1.0' encoding='UTF-8' ?>
0d26a2bd71224b954baab529bbadc4d676c35b95slive<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<manualpage>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<relativepath href="."/>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd <title>Configuration Files</title>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<summary>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd<p>This document describes the files used to configure the Apache
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdndHTTP server.</p>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd</summary>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <section id="main">
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <title>Main Configuration Files</title>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <related>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <modulelist>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <module>mod_mime</module>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd </modulelist>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <directivelist>
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd <directive module="core" type="section">IfDefine</directive>
7db9f691a00ead175b03335457ca296a33ddf31bnd <directive module="core">Include</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directive module="mod_mime">TypesConfig</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </directivelist>
0d26a2bd71224b954baab529bbadc4d676c35b95slive </related>
0d26a2bd71224b954baab529bbadc4d676c35b95slive
0d26a2bd71224b954baab529bbadc4d676c35b95slive <p>Apache is configured by placing <a
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen href="mod/directives.html">directives</a> in plain text
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen configuration files. The main configuration file is usually called
0d26a2bd71224b954baab529bbadc4d676c35b95slive <code>httpd.conf</code>. The location of this file is set at
0d26a2bd71224b954baab529bbadc4d676c35b95slive compile-time, but may be overridden with the <code>-f</code>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen command line flag. In addition, other configuration files may be
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen added using the <directive module="core">Include</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen directive, and wildcards can be used to include many configuration
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen files. Any directive may be placed in any of these configuration
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen files. Changes to the main configuration files are only
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen recognized by Apache when it is started or restarted.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>The server also reads a file containing mime document types;
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen the filename is set by the <directive
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen module="mod_mime">TypesConfig</directive> directive,
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen and is <code>mime.types</code> by default.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </section>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <section id="syntax">
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <title>Syntax of the Configuration Files</title>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>Apache configuration files contain one directive per line.
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen The back-slash "\" may be used as the last character on a line
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen to indicate that the directive continues onto the next line.
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen There must be no other characters or white space between the
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen back-slash and the end of the line.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>Directives in the configuration files are case-insensitive,
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen but arguments to directives are often case sensitive. Lines
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen that begin with the hash character "#" are considered
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen comments, and are ignored. Comments may <strong>not</strong> be
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen included on a line after a configuration directive. Blank lines
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen and white space occurring before a directive are ignored, so
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen you may indent directives for clarity.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>You can check your configuration files for syntax errors
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen without starting the server by using <code>apachectl
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen configtest</code> or the <code>-t</code> command line
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen option.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </section>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
0d26a2bd71224b954baab529bbadc4d676c35b95slive <section id="modules">
0d26a2bd71224b954baab529bbadc4d676c35b95slive <title>Modules</title>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <related>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <modulelist>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <module>mod_so</module>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </modulelist>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directivelist>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directive module="core" type="section">IfModule</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directive module="mod_so">LoadModule</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </directivelist>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </related>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>Apache is a modular server. This implies that only the most
0d26a2bd71224b954baab529bbadc4d676c35b95slive basic functionality is included in the core server. Extended
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen features are available through <a
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen href="mod/">modules</a> which can be loaded
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen into Apache. By default, a <a
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen href="mod/module-dict.html#Status">base</a> set of modules is
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen included in the server at compile-time. If the server is
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen compiled to use <a href="dso.html">dynamically loaded</a>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen modules, then modules can be compiled separately and added at
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen any time using the <directive module="mod_so">LoadModule</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen directive.
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen Otherwise, Apache must be recompiled to add or remove modules.
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen Configuration directives may be included conditional on a
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen presence of a particular module by enclosing them in an<directive
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen module="core" type="section">IfModule</directive> block.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>To see which modules are currently compiled into the server,
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen you can use the <code>-l</code> command line option.</p>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen </section>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <section id="scope">
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <title>Scope of Directives</title>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen
0d26a2bd71224b954baab529bbadc4d676c35b95slive <related>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directivelist>
0d26a2bd71224b954baab529bbadc4d676c35b95slive <directive module="core" type="section">Directory</directive>
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <directive module="core" type="section">DirectoryMatch</directive>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin <directive module="core" type="section">Files</directive>
b9b166bce28378f88ecba40c17f788f510b8357and <directive module="core" type="section">FilesMatch</directive>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin <directive module="core" type="section">Location</directive>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin <directive module="core" type="section">LocationMatch</directive>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin <directive module="core" type="section">VirtualHost</directive>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin </directivelist>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin </related>
b1d5e64b28c637587fe6809bc1a19be1730545d4martin
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen <p>Directives placed in the main configuration files apply to
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen the entire server. If you wish to change the configuration for
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen only a part of the server, you can scope your directives by
15b99496bfd5c7809028689a3accc488b23ab0b4rbowen placing them in <directive module="core"
type="section">Directory</directive>, <directive module="core"
type="section">DirectoryMatch</directive>, <directive module="core"
type="section">Files</directive>, <directive module="core"
type="section">FilesMatch</directive>, <directive module="core"
type="section">Location</directive>, and <directive module="core"
type="section">LocationMatch</directive>
sections. These sections limit the application of the
directives which they enclose to particular filesystem
locations or URLs. They can also be nested, allowing for very
fine grained configuration.</p>
<p>Apache has the capability to serve many different websites
simultaneously. This is called <a href="vhosts/">Virtual
Hosting</a>. Directives can also be scoped by placing them
inside <directive module="core" type="section">VirtualHost</directive>
sections, so that they will only apply to requests for a
particular website.</p>
<p>Although most directives can be placed in any of these
sections, some directives do not make sense in some contexts.
For example, directives controlling process creation can only
be placed in the main server context. To find which directives
can be placed in which sections, check the <a
href="mod/directive-dict.html#Context">Context</a> of the
directive. For further information, we provide details on <a
href="sections.html">How Directory, Location and Files sections
work</a>.</p>
</section>
<section id="htaccess">
<title>.htaccess Files</title>
<related>
<directivelist>
<directive module="core">AccessFileName</directive>
<directive module="core">AllowOverride</directive>
</directivelist>
</related>
<p>Apache allows for decentralized management of configuration
via special files placed inside the web tree. The special files
are usually called <code>.htaccess</code>, but any name can be
specified in the <directive module="core">AccessFileName</directive>
directive. Directives placed in <code>.htaccess</code> files
apply to the directory where you place the file, and all
sub-directories. The <code>.htaccess</code> files follow the
same syntax as the main configuration files. Since
<code>.htaccess</code> files are read on every request, changes
made in these files take immediate effect.</p>
<p>To find which directives can be placed in
<code>.htaccess</code> files, check the <a
href="mod/directive-dict.html#Context">Context</a> of the
directive. The server administrator further controls what
directives may be placed in <code>.htaccess</code> files by
configuring the <directive module="core">AllowOverride</directive>
directive in the main configuration files.</p>
<p>For more information on <code>.htaccess</code> files, see
the <a href="howto/htaccess.html">.htaccess tutorial</a>.</p>
</section>
</manualpage>