configuring.xml revision 30371ea2f088b41d009cd8699529df314b25994a
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<?xml version='1.0' encoding='UTF-8' ?>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<!DOCTYPE manualpage SYSTEM "/style/manualpage.dtd">
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<manualpage>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<relativepath href="."/>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <title>Configuration Files</title>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<summary>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd<p>This document describes the files used to configure the Apache
0853e1e2522c1ac17f697221758bcbd4781a7ff9ndHTTP server.</p>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd</summary>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <section id="main">
27e52281f1522522b170cafc76b08b58aa70ccaand <title>Main Configuration Files</title>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <related>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <modulelist>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <module>mod_mime</module>
4b5981e276e93df97c34e4da05ca5cf8bbd937dand </modulelist>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <directivelist>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <directive module="core" type="section">IfDefine</directive>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd <directive module="core">Include</directive>
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi <directive module="mod_mime">TypesConfig</directive>
bc9d4698fce0238d2f6f2682e99423ebb1149976rbowen </directivelist>
ad74a0524a06bfe11b7de9e3b4ce7233ab3bd3f7nd </related>
63f06dce77bb2d9b1c5aa5deeb47a1069987fd1end
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen <p>Apache is configured by placing <a
d474d8ef01ec5c2a09341cd148851ed383c3287crbowen href="mod/directives.html">directives</a> in plain text
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd configuration files. The main configuration file is usually
45a544a8bb3fa1f95e5edac9fb3e723e2bb7001drbowen called <code>httpd.conf</code>. The location of this file is
45a544a8bb3fa1f95e5edac9fb3e723e2bb7001drbowen set at compile-time, but may be overridden with the
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <code>-f</code> command line flag. In addition, other
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd configuration files may be added using the <directive
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd module="core">Include</directive> directive. Any
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd directive may be placed in any of these configuration files.
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd Changes to the main configuration files are only recognized by
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd Apache when it is started or restarted.</p>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>New with Apache 1.3.13 is a feature where if any
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd configuration file is actually a directory, Apache will enter
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd that directory and parse any files (and subdirectories) found
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd there as configuration files. One possible use for this would
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd be to add VirtualHosts by creating small configuration files
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd for each host, and placing them in such a configuration
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd directory. Thus, you can add or remove VirtualHosts without
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd editing any files at all, simply adding or deleting them. This
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd makes automating such processes much easier.</p>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>The server also reads a file containing mime document types;
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd the filename is set by the <directive
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd module="mod_mime">TypesConfig</directive> directive,
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd and is <code>mime.types</code> by default.</p>
80eed96ee3d8cfa0b66d9fb1cfe63fd83254d38bnilgun </section>
80eed96ee3d8cfa0b66d9fb1cfe63fd83254d38bnilgun
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <section id="syntax">
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <title>Syntax of the Configuration Files</title>
316f02e3836836c82e19019ff23f90a7ebc65289nilgun
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>Apache configuration files contain one directive per line.
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd The back-slash "\" may be used as the last character on a line
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd to indicate that the directive continues onto the next line.
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd There must be no other characters or white space between the
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd back-slash and the end of the line.</p>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>Directives in the configuration files are case-insensitive,
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd but arguments to directives are often case sensitive. Lines
08cf4a15275e4cb65a424b3a1db5410bfb51085cjim which begin with the hash character "#" are considered
22d5d84393d960a2027f472036f3fee15d7dbce9nd comments, and are ignored. Comments may <strong>not</strong> be
22d5d84393d960a2027f472036f3fee15d7dbce9nd included on a line after a configuration directive. Blank lines
22d5d84393d960a2027f472036f3fee15d7dbce9nd and white space occurring before a directive are ignored, so
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd you may indent directives for clarity.</p>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <p>You can check your configuration files for syntax errors
50c04f297d76a57ead2fa6b73845f7563b1fc788sf without starting the server by using <code>apachectl
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd configtest</code> or the <code>-t</code> command line
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd option.</p>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd </section>
623eebe956d9c2d6d073ed3eae855b56030b40e9noodl
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <section id="modules">
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <title>Modules</title>
ffb88a4885747797937e30a5ac8b1606da3cb4adnd
909ce17e2bd0faef7b1c294f2307f009793fd493nd <related>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <modulelist>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <module>mod_so</module>
cd34a6fbf0a2619544a72eadb73f309370bf6682wrowe </modulelist>
cd34a6fbf0a2619544a72eadb73f309370bf6682wrowe <directivelist>
42af92a661a06b3cebc88d585aad75064a309d51nd <directive module="core" type="section">IfModule</directive>
42af92a661a06b3cebc88d585aad75064a309d51nd <directive module="mod_so">LoadModule</directive>
ffb88a4885747797937e30a5ac8b1606da3cb4adnd </directivelist>
6fe26506780e73be2a412d758af77fafdf03291and </related>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <p>Apache is a modular server. This implies that only the most
9649d29bb7801e0698e6a845e1a8a61534df58b3noodl basic functionality is included in the core server. Extended
9649d29bb7801e0698e6a845e1a8a61534df58b3noodl features are available through <a
a78048ccbdb6256da15e6b0e7e95355e480c2301nd href="mod/index-bytype.html">modules</a> which can be loaded
a78048ccbdb6256da15e6b0e7e95355e480c2301nd into Apache. By default, a <a
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd href="mod/module-dict.html#Status">base</a> set of modules is
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd included in the server at compile-time. If the server is
08cf4a15275e4cb65a424b3a1db5410bfb51085cjim compiled to use <a href="dso.html">dynamically loaded</a>
6aadbc6fd703e73d1d419e9f06b84a4338c898f1maczniak modules, then modules can be compiled separately and added at
78f97ce162b66a0dbfd7af4dcd9984f162569b04minfrin any time using the <directive module="mod_so">LoadModule</directive>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd directive.
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd Otherwise, Apache must be recompiled to add or remove modules.
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd Configuration directives may be included conditional on a
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd presence of a particular module by enclosing them in an<directive
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd module="core" type="section">IfModule</directive> block.</p>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <p>To see which modules are currently compiled into the server,
05ede5110427cb9dc071cc671d5aaba5d3b88c79nd you can use the <code>-l</code> command line option.</p>
e8b603fa9ccf7b17b11b42df6d8916fd97c2331dnd </section>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd
4ed26c413f67a5aae20b95909828f30bb5dc2286poirier <section id="scope">
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <title>Scope of Directives</title>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd
611049e38bfbaeb173d2d7fab2e44a48753436a1nd <related>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <directivelist>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <directive module="core" type="section">Directory</directive>
8574d86b9ec3be36b7f54ed0547a0ee5d60dbd6bnd <directive module="core" type="section">DirectoryMatch</directive>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <directive module="core" type="section">Files</directive>
6aadbc6fd703e73d1d419e9f06b84a4338c898f1maczniak <directive module="core" type="section">FilesMatch</directive>
6aadbc6fd703e73d1d419e9f06b84a4338c898f1maczniak <directive module="core" type="section">Location</directive>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <directive module="core" type="section">LocationMatch</directive>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <directive module="core" type="section">VirtualHost</directive>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd </directivelist>
03a4ff9ac4c9b8009249010e7c53bb86ff05915and </related>
f21bea4c0f58e17aa1d9a0fac2c219852f89944amaczniak
d0828c8a321dc5e9ea60550f052294669c08cf93jim <p>Directives placed in the main configuration files apply to
d0828c8a321dc5e9ea60550f052294669c08cf93jim the entire server. If you wish to change the configuration for
f21bea4c0f58e17aa1d9a0fac2c219852f89944amaczniak only a part of the server, you can scope your directives by
4b5981e276e93df97c34e4da05ca5cf8bbd937dand placing them in <directive module="core"
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd type="section">Directory</directive>, <directive module="core"
f21bea4c0f58e17aa1d9a0fac2c219852f89944amaczniak type="section">DirectoryMatch</directive>, <directive module="core"
6aadbc6fd703e73d1d419e9f06b84a4338c898f1maczniak type="section">Files</directive>, <directive module="core"
2704de98885368683621b01c8f8f4e4b01557611takashi type="section">FilesMatch</directive>, <directive module="core"
2704de98885368683621b01c8f8f4e4b01557611takashi type="section">Location</directive>, and <directive module="core"
2704de98885368683621b01c8f8f4e4b01557611takashi type="section">LocationMatch</directive>
d0828c8a321dc5e9ea60550f052294669c08cf93jim sections. These sections limit the application of the
2704de98885368683621b01c8f8f4e4b01557611takashi directives which they enclose to particular filesystem
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd locations or URLs. They can also be nested, allowing for very
6aadbc6fd703e73d1d419e9f06b84a4338c898f1maczniak fine grained configuration.</p>
d2b809e5d72658bff23819d8b77f20e4939af541nd
a78048ccbdb6256da15e6b0e7e95355e480c2301nd <p>Apache has the capability to serve many different websites
4ed26c413f67a5aae20b95909828f30bb5dc2286poirier simultaneously. This is called <a href="vhosts/">Virtual
4ed26c413f67a5aae20b95909828f30bb5dc2286poirier Hosting</a>. Directives can also be scoped by placing them
cd6c8de3bedcc401ee230159b0439fa20f44488etakashi inside <directive module="core" type="section">VirtualHost</directive>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd sections, so that they will only apply to requests for a
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd particular website.</p>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>Although most directives can be placed in any of these
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd sections, some directives do not make sense in some contexts.
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd For example, directives controlling process creation can only
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd be placed in the main server context. To find which directives
1de1266f0ea387d6373be8415745dfd2ab876341jim can be placed in which sections, check the <a
27d778df0b517e1578f907d2e51eb961cd8ee5fbjim href="mod/directive-dict.html#Context">Context</a> of the
a610901168de82df5fc5d99b8759fd80e0f70aeasf directive. For further information, we provide details on <a
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977nd href="sections.html">How Directory, Location and Files sections
a43bfa789f4e52dde53ae8e53fa0427b5c1cf977nd work</a>.</p>
28c9d384aa958b321280b4ac886941dcad25396bnd </section>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <section id="htaccess">
438b4817913a5ff55d9cad4c7ddf133330b4466ejim <title>.htaccess Files</title>
438b4817913a5ff55d9cad4c7ddf133330b4466ejim
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi <related>
e5ce3ac0e9b720c0fa23782e29168a0810697fdetakashi <directivelist>
604c89126c27104f659d7a51b0113e3bd435faf8fielding <directive module="core">AccessFileName</directive>
50cb7e2b30597f481fee57bac945190f06ebcc58jorton <directive module="core">AllowOverride</directive>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd </directivelist>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd </related>
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <p>Apache allows for decentralized management of configuration
0a69d9bb491d9810892a9949c01403a1de3c7ac2nd via special files placed inside the web tree. The special files
4ed26c413f67a5aae20b95909828f30bb5dc2286poirier are usually called <code>.htaccess</code>, but any name can be
4ed26c413f67a5aae20b95909828f30bb5dc2286poirier specified in the <directive module="core">AccessFileName</directive>
6d20aeba2c4aa0938bc6e0659d13adc7670ff421poirier directive. Directives placed in <code>.htaccess</code> files
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe apply to the directory where you place the file, and all
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe sub-directories. The <code>.htaccess</code> files follow the
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe same syntax as the main configuration files. Since
11495c9f0bd33e51a25b4d532beadfbcf9b944a3nilgun <code>.htaccess</code> files are read on every request, changes
11495c9f0bd33e51a25b4d532beadfbcf9b944a3nilgun made in these files take immediate effect.</p>
5f4e50966b2b9b58436a1651cbe588d1b595657ewrowe
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi <p>To find which directives can be placed in
0853e1e2522c1ac17f697221758bcbd4781a7ff9nd <code>.htaccess</code> files, check the <a
50cb7e2b30597f481fee57bac945190f06ebcc58jorton href="mod/directive-dict.html#Context">Context</a> of the
79b024b81f6bb3c44dce77a7552191daf8b522d2jim directive. The server administrator further controls what
f772e8f448c223e5ea306f1bf92d97d968f972d5jim directives may be placed in <code>.htaccess</code> files by
f772e8f448c223e5ea306f1bf92d97d968f972d5jim configuring the <directive module="core">AllowOverride</directive>
fac8c35bfb158112226ab43ddf84d59daca5dc30nd directive in the main configuration files.</p>
f772e8f448c223e5ea306f1bf92d97d968f972d5jim
1de1266f0ea387d6373be8415745dfd2ab876341jim <p>For more information on <code>.htaccess</code> files, see
1de1266f0ea387d6373be8415745dfd2ab876341jim Ken Coar's tutorial on <a
a78048ccbdb6256da15e6b0e7e95355e480c2301nd href="http://apache-server.com/tutorials/ATusing-htaccess.html">
a78048ccbdb6256da15e6b0e7e95355e480c2301nd Using .htaccess Files with Apache</a>.</p>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd </section>
a78048ccbdb6256da15e6b0e7e95355e480c2301nd</manualpage>