]> granicus.if.org Git - apache/commitdiff
Add document explaining how Directory, Location and Files sections
authorpcs <pcs@unknown>
Sun, 24 Aug 1997 14:16:04 +0000 (14:16 +0000)
committerpcs <pcs@unknown>
Sun, 24 Aug 1997 14:16:04 +0000 (14:16 +0000)
are merged. Based on Dean's explanation from PR#586. Link to this
doc from the directive descriptions in core.html.

PR: 586

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@79051 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/core.html
docs/manual/sections.html [new file with mode: 0644]
docs/manual/sections.html.en [new file with mode: 0644]

index daa64679171837f77ed98b0a3172043997c4797e..55e6252da949ac58c138cc816bd730c80fd0692f 100644 (file)
@@ -413,7 +413,13 @@ page for more details.
 The directory sections typically occur in the access.conf file, but they
 may appear in any configuration file. &lt;Directory&gt; directives cannot
 nest, and cannot appear in a <A HREF="#limit">&lt;Limit&gt;</A> section.
-<p><hr>
+<p>
+
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
+
+<hr>
 
 <h2><A name="directorymatch">&lt;DirectoryMatch&gt;</A></h2>
 <strong>Syntax:</strong> &lt;DirectoryMatch <em>regex</em>&gt; ... &lt;/DirectoryMatch&gt; <br>
@@ -435,7 +441,11 @@ argument a regular expression. For example:</p>
 
 <p><strong>See Also:</strong>
 <a href="#directory">&lt;Directory&gt;</a> for a description of how
-regular expressions are mixed in with normal &lt;Directory&gt;s.</p>
+regular expressions are mixed in with normal &lt;Directory&gt;s.
+<br>
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
 
 <hr>
 
@@ -573,7 +583,13 @@ file-by-file level. When used in an .htaccess file, if the
 <em>filename</em> does not begin with a <code>/</code> character,
 the directory being applied will be prefixed automatically.
 
-<p> <hr>
+<p>
+
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
+
+<hr>
 
 <h2><A name="filesmatch">&lt;FilesMatch&gt;</A></h2>
 <strong>Syntax:</strong> &lt;FilesMatch <em>regex</em>&gt;
@@ -593,6 +609,10 @@ does. However, it accepts a regular expression. For example:</p>
 
 <p>would match most common Internet graphics formats.</p>
 
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
+
 <hr>
 
 <h2><A name="group">Group directive</A></h2>
@@ -919,6 +939,12 @@ from browsers at foo.com, you might use:
     allow from .foo.com
     &lt;/Location&gt;
 </pre>
+
+<p>
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
+
 <hr>
 
 <h2><a name="locationmatch">&lt;LocationMatch&gt;</a></h2>
@@ -942,6 +968,10 @@ expression as an argument instead of a simple string. For example:</p>
 <p>would match URLs that contained the substring "/extra/data" or
 "/special/data".</p>
 
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
+
 <hr>
 
 <H2><A NAME="lockfile">LockFile directive</A></H2>
@@ -1681,7 +1711,10 @@ href="#listen">Listen</a>.
 <strong>See also:</strong>
 <a href="../vhosts-in-depth.html">In-depth description of Virtual Host matching</a><br>
 <strong>See also:</strong>
-<a href="../bind.html">Setting which addresses and ports Apache uses</a>
+<a href="../bind.html">Setting which addresses and ports Apache uses</a><br>
+<strong>See also</strong>: <a href="../sections.html">How Directory,
+Location and Files sections work</a> for an explanation of how these
+different sections are combined when a request is received
 </p>
 
 <!--#include virtual="footer.html" -->
diff --git a/docs/manual/sections.html b/docs/manual/sections.html
new file mode 100644 (file)
index 0000000..a145a56
--- /dev/null
@@ -0,0 +1,139 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><head>
+<title>How Directory, Location and Files sections work</title>
+</head>
+
+<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
+<BODY
+ BGCOLOR="#FFFFFF"
+ TEXT="#000000"
+ LINK="#0000FF"
+ VLINK="#000080"
+ ALINK="#FF0000"
+>
+<!--#include virtual="header.html" -->
+<h1 ALIGN="CENTER">How Directory, Location and Files sections work</h1>
+
+The sections <a
+href="mod/core.html#directory"><code>&lt;Directory&gt;</code></a>, <a
+href="mod/core.html#location"><code>&lt;Location&gt;</code></a> and <a
+href="mode/core.html#files"><code>&lt;Files&gt;</code></a> can contain
+directives which only apply to specified directories, URLs or files
+respectively. Also htaccess files can be used inside a directory to
+apply directives to that directory. This document explains how these
+different sections differ and how they relate to each other when
+Apache decides which directives apply for a particular directory or
+request URL.
+
+<h2>Directives allowed in the sections</h2>
+
+Everything that is syntactically allowed in
+<code>&lt;Directory&gt;</code> is also allowed in
+<code>&lt;Location&gt;</code> (except a sub-<code>&lt;Files&gt;</code>
+section, but the code doesn't test for that, Lars has an open bug
+report on that).  Semantically however some things, and the most
+notable is AllowOverrides, make no sense in
+<code>&lt;Location&gt;</code>.  The same for
+<code>&lt;Files&gt;</code> -- syntactically everything is fine, but
+semantically some things are different.
+
+<h2>How the sections are merged</h2>
+
+The order of merging is:
+
+<ol>
+
+<li>
+
+ <code>&lt;Directory&gt;</code> (except regular expressions) and
+ .htaccess done simultaneously (with .htaccess overriding
+ <code>&lt;Directory&gt;</code>)
+
+</li>
+
+<li>
+ <code>&lt;DirectoryMatch&gt;</code>, and
+ <code>&lt;Directory&gt;</code> with regular expressions
+
+</li>
+
+ <li><code>&lt;Files&gt;</code> and <code>&lt;FilesMatch&gt;</code> done simultaneously
+ </li>
+
+ <li><code>&lt;Location&gt;</code> and <code>&lt;LocationMatch&gt;</code> done simultaneously
+ </li>
+
+</ol>
+
+Apart from <code>&lt;Directory&gt;</code>, each group is processed in
+the order that they appear in the configuration
+files. <code>&lt;Directory&gt;</code> (group 1 above) is processed in
+the order shortest directory component to longest. If multiple
+<code>&lt;Directory&gt;</code> sections apply to the same directory
+they they are processed in the configuration file order.  The
+configuration files are read in the order httpd.conf, srm.conf and
+access.conf. Configurations included via the <code>Include</code>
+directive will be treated as if they where inside the including file
+at the location of the <code>Include</code> directive.
+
+<p>
+
+Sections inside <code>&lt;VirtualHost&gt;</code> sections are applied
+<i>after</i> the corresponding sections outside the virtual host
+definition. This allows virtual hosts to override the main server
+configuration. (Note: this only works correctly from 1.2.2 and 1.3a2
+onwards. Before those releases sections inside virtual hosts were
+applied <i>before</i> the main server).
+
+<h2>Notes about using sections</h2>
+
+The general guidelines are:
+
+<p>
+
+<ul>
+<li>
+    If you are attempting to match objects at the filesystem level
+    then you must use <code>&lt;Directory&gt;</code> and/or
+    <code>&lt;Files&gt;</code>.
+</li>
+
+<li>
+    If you are attempting to match objects at the URL level then you
+    must use <code>&lt;Location&gt;</code>
+</li>
+</ul>
+
+But a notable exception is:
+
+<ul>
+<li>
+    proxy control is done via <code>&lt;Directory&gt;</code>.  This is
+    a legacy mistake because the proxy existed prior to
+    <code>&lt;Location&gt;</code>.  A future version of the config
+    language should probably switch this to
+    <code>&lt;Location&gt;</code>.
+</li>
+</ul>
+
+Note also that modifying .htaccess parsing during Location doesn't do
+anything because .htaccess parsing has already occured.
+
+<p>
+
+Another note:
+<p>
+
+<ul>
+<li>
+    There is actually a
+    <code>&lt;Location&gt;</code>/<code>&lt;LocationMatch&gt;</code>
+    sequence performed just before the name translation phase (where
+    <code>Aliases</code> and <code>DocumentRoots</code> are used to
+    map URLs to filenames).  The results of this sequence are
+    completely thrown away after the translation has completed.
+</li>
+</ul>
+
+<!--#include virtual="footer.html" -->
+</body></html>
diff --git a/docs/manual/sections.html.en b/docs/manual/sections.html.en
new file mode 100644 (file)
index 0000000..a145a56
--- /dev/null
@@ -0,0 +1,139 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html><head>
+<title>How Directory, Location and Files sections work</title>
+</head>
+
+<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
+<BODY
+ BGCOLOR="#FFFFFF"
+ TEXT="#000000"
+ LINK="#0000FF"
+ VLINK="#000080"
+ ALINK="#FF0000"
+>
+<!--#include virtual="header.html" -->
+<h1 ALIGN="CENTER">How Directory, Location and Files sections work</h1>
+
+The sections <a
+href="mod/core.html#directory"><code>&lt;Directory&gt;</code></a>, <a
+href="mod/core.html#location"><code>&lt;Location&gt;</code></a> and <a
+href="mode/core.html#files"><code>&lt;Files&gt;</code></a> can contain
+directives which only apply to specified directories, URLs or files
+respectively. Also htaccess files can be used inside a directory to
+apply directives to that directory. This document explains how these
+different sections differ and how they relate to each other when
+Apache decides which directives apply for a particular directory or
+request URL.
+
+<h2>Directives allowed in the sections</h2>
+
+Everything that is syntactically allowed in
+<code>&lt;Directory&gt;</code> is also allowed in
+<code>&lt;Location&gt;</code> (except a sub-<code>&lt;Files&gt;</code>
+section, but the code doesn't test for that, Lars has an open bug
+report on that).  Semantically however some things, and the most
+notable is AllowOverrides, make no sense in
+<code>&lt;Location&gt;</code>.  The same for
+<code>&lt;Files&gt;</code> -- syntactically everything is fine, but
+semantically some things are different.
+
+<h2>How the sections are merged</h2>
+
+The order of merging is:
+
+<ol>
+
+<li>
+
+ <code>&lt;Directory&gt;</code> (except regular expressions) and
+ .htaccess done simultaneously (with .htaccess overriding
+ <code>&lt;Directory&gt;</code>)
+
+</li>
+
+<li>
+ <code>&lt;DirectoryMatch&gt;</code>, and
+ <code>&lt;Directory&gt;</code> with regular expressions
+
+</li>
+
+ <li><code>&lt;Files&gt;</code> and <code>&lt;FilesMatch&gt;</code> done simultaneously
+ </li>
+
+ <li><code>&lt;Location&gt;</code> and <code>&lt;LocationMatch&gt;</code> done simultaneously
+ </li>
+
+</ol>
+
+Apart from <code>&lt;Directory&gt;</code>, each group is processed in
+the order that they appear in the configuration
+files. <code>&lt;Directory&gt;</code> (group 1 above) is processed in
+the order shortest directory component to longest. If multiple
+<code>&lt;Directory&gt;</code> sections apply to the same directory
+they they are processed in the configuration file order.  The
+configuration files are read in the order httpd.conf, srm.conf and
+access.conf. Configurations included via the <code>Include</code>
+directive will be treated as if they where inside the including file
+at the location of the <code>Include</code> directive.
+
+<p>
+
+Sections inside <code>&lt;VirtualHost&gt;</code> sections are applied
+<i>after</i> the corresponding sections outside the virtual host
+definition. This allows virtual hosts to override the main server
+configuration. (Note: this only works correctly from 1.2.2 and 1.3a2
+onwards. Before those releases sections inside virtual hosts were
+applied <i>before</i> the main server).
+
+<h2>Notes about using sections</h2>
+
+The general guidelines are:
+
+<p>
+
+<ul>
+<li>
+    If you are attempting to match objects at the filesystem level
+    then you must use <code>&lt;Directory&gt;</code> and/or
+    <code>&lt;Files&gt;</code>.
+</li>
+
+<li>
+    If you are attempting to match objects at the URL level then you
+    must use <code>&lt;Location&gt;</code>
+</li>
+</ul>
+
+But a notable exception is:
+
+<ul>
+<li>
+    proxy control is done via <code>&lt;Directory&gt;</code>.  This is
+    a legacy mistake because the proxy existed prior to
+    <code>&lt;Location&gt;</code>.  A future version of the config
+    language should probably switch this to
+    <code>&lt;Location&gt;</code>.
+</li>
+</ul>
+
+Note also that modifying .htaccess parsing during Location doesn't do
+anything because .htaccess parsing has already occured.
+
+<p>
+
+Another note:
+<p>
+
+<ul>
+<li>
+    There is actually a
+    <code>&lt;Location&gt;</code>/<code>&lt;LocationMatch&gt;</code>
+    sequence performed just before the name translation phase (where
+    <code>Aliases</code> and <code>DocumentRoots</code> are used to
+    map URLs to filenames).  The results of this sequence are
+    completely thrown away after the translation has completed.
+</li>
+</ul>
+
+<!--#include virtual="footer.html" -->
+</body></html>