ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaie_5.4.0.1/rzaiecontext.htm

294 lines
19 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="topic" />
<meta name="DC.Title" content="Fundamental directive, context, and server area concepts on HTTP Server (powered by Apache)" />
<meta name="abstract" content="This topic provides information on the fundamental directive, context, and server area concepts on HTTP Server (powered by Apache)." />
<meta name="description" content="This topic provides information on the fundamental directive, context, and server area concepts on HTTP Server (powered by Apache)." />
<meta name="DC.Relation" scheme="URI" content="rzaieconcepts.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzaiecontext" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Fundamental directive, context, and server area concepts on HTTP Server
(powered by Apache)</title>
</head>
<body id="rzaiecontext"><a name="rzaiecontext"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Fundamental directive, context, and server area concepts on HTTP Server
(powered by Apache)</h1>
<div><p>This topic provides information on the fundamental directive, context,
and server area concepts on HTTP Server (powered by Apache).</p>
<div class="important"><span class="importanttitle">Important:</span> Information
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
It is recommended that you install the latest PTFs to upgrade to the latest
level of the HTTP Server for i5/OS. Some of the topics documented here are
not available prior to this update. See <a href="http://www-03.ibm.com/servers/eserver/iseries/software/http/services/service.html" target="_blank">http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm</a> <img src="www.gif" alt="Link outside Information Center" /> for more information. </div>
<p>The HTTP Server is configured using directives. A directive is used to
define an attribute of the HTTP Server or how the HTTP Server operates. For
example, the Listen directive defines what port the HTTP Server (powered by
Apache) should wait on to handle incoming requests. </p>
<p>With the HTTP Server (powered by Apache), the directives are extensive,
functional, and built around the concept of context. </p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaieconcepts.htm" title="This topic provides concepts of functions on HTTP Server and IBM Web Administration for i5/OS interface.">Concepts of functions of HTTP Server</a></div>
</div>
</div><div class="nested1" id="categories"><a name="categories"><!-- --></a><h2 class="topictitle2">Directive categories of HTTP Server (powered by Apache)</h2>
<div><p>The HTTP Server (powered by Apache) directives may be categorized into
two main groups. These are Assignment directives and Container directives. </p>
<dl><dt class="dlterm">Assignment directives </dt>
<dd>Used to configure the function or characteristics of the HTTP Server (powered
by Apache). For example, the Listen directive assigns the port the HTTP Server
(powered by Apache) should use to handle incoming requests. </dd>
</dl>
<dl><dt class="dlterm">Container directives </dt>
<dd>Used to group directives together within the HTTP Server (powered by Apache).
The container directives group one or more assignment directives which are
used to control the function intended specifically within the context of the
container. For example, the &lt;Directory&gt; directive is used to enclose a
group of assignment directives that only apply to the directory and subdirectory
context.</dd>
<dd class="ddexpand">When dealing with container directives, individual assignment directives
may not be valid within one or more container directives due to improper context.
See <a href="rzaiedirective.htm">Directives for HTTP Server</a> for more information
on the specific context a directive may or may not be used. </dd>
</dl>
</div>
</div>
<div class="nested1" id="directivecontext"><a name="directivecontext"><!-- --></a><h2 class="topictitle2">HTTP Server directive contexts</h2>
<div><p>Understanding the context concept is necessary to increase the productivity
and usefulness of your HTTP Server (powered by Apache). The <span>IBM<sup>®</sup> Web Administration for i5/OS™ interface</span> assists
in managing context areas of your server. By selecting a different area of
the server area, you are changing the context you are managing. </p>
<p>These types of directive contexts are supported: </p>
<dl><dt class="dlterm">server config </dt>
<dd>Also called "Server Area", "Global Level" or "Global Context". The attributes
set by directives in the server config context can and most likely will be
inherited by the container directives and assignment directives used in the
configuration. </dd>
</dl>
<dl><dt class="dlterm">directory </dt>
<dd>Also called "Container Context", the directory context should not be confused
with &lt;Directory&gt; containers. If the directive supports this context, the
directive can be used in most containers (&lt;Directory&gt;, &lt;File&gt;, &lt;Proxy&gt;,
and &lt;Location&gt; for example). This context support does not apply to virtual
hosts. There are limited exceptions where directives are not supported in
all of the containers associated with this context. See <a href="rzaiedirective.htm">Directives for HTTP Server</a> for specific directive exceptions. </dd>
</dl>
<dl><dt class="dlterm">virtual host</dt>
<dd>The virtual host context refers to directives that are allowed to be configured,
or assigned, in the &lt;Virtual Host&gt; container directive.</dd>
</dl>
<dl><dt class="dlterm"><strong>.htaccess</strong></dt>
<dd>Also called ".htaccess files", the .htaccess context refers to directives
supported in per-directory configuration files. Per-directory configuration
files are read by the server from the physical directory where they reside.
The directives within this file are applied to any objects that are to be
served from the directory where the file exists, and may also be carried forward
to sub-directories. Note that the use of .htaccess files is not recommended
due to the additional overhead incurred by the server.</dd>
</dl>
</div>
</div>
<div class="nested1" id="containertypes"><a name="containertypes"><!-- --></a><h2 class="topictitle2">HTTP Server container types</h2>
<div><p>The directives used to configure HTTP Server (powered by Apache) containers
are encased in greater than (&gt;) and lesser than (&lt;) brackets. For example, &lt;Directory&gt;
is a container directive. Each container is comprised of an opening directive,
such as &lt;Directory&gt;, and closed with the same context directive prefixed
with a slash (/). For example, &lt;/Directory&gt;. </p>
<p>There are six different types of container directives. Five of the six
container directives listed below have variants which results in a total of
eleven different container directives (shown below with the opening and closing
tags).</p>
<dl><dt class="dlterm"><strong>Directory and DirectoryMatch</strong></dt>
<dd><a href="rzaiemod_core.htm#directory">&lt;Directory <em>directory</em>&gt;...&lt;/Directory&gt;</a></dd>
<dd class="ddexpand"><a href="rzaiemod_core.htm#directorymatch">&lt;DirectoryMatch <em>regex</em>&gt;...&lt;/DirectoryMatch&gt; </a></dd>
</dl>
<dl><dt class="dlterm">Files and FilesMatch</dt>
<dd><a href="rzaiemod_core.htm#files">&lt;Files <em>filename</em>&gt;...&lt;/Files&gt;</a> </dd>
<dd class="ddexpand"><a href="rzaiemod_core.htm#filesmatch">&lt;FilesMatch <em>regex</em>&gt;...&lt;/FilesMatch&gt;</a></dd>
</dl>
<dl><dt class="dlterm">Location and LocationMatch</dt>
<dd><a href="rzaiemod_core.htm#location">&lt;Location <em>URL</em>&gt;...&lt;/Location&gt; </a></dd>
<dd class="ddexpand"><a href="rzaiemod_core.htm#locationmatch">&lt;LocationMatch <em>regex</em>&gt;...&lt;/LocationMatch&gt;</a></dd>
</dl>
<dl><dt class="dlterm">Proxy and ProxyMatch</dt>
<dd><a href="rzaiemod_proxy.htm#proxy">&lt;Proxy <em>criteria</em>&gt;...&lt;/Proxy&gt;</a></dd>
<dd class="ddexpand"><a href="rzaiemod_proxy.htm#proxymatch">&lt;ProxyMatch <em>regex</em>&gt;...&lt;/ProxyMatch&gt;</a></dd>
</dl>
<dl><dt class="dlterm">VirtualHost</dt>
<dd><a href="rzaiemod_core.htm#virtualhost">&lt;VirtualHost <em>addr[:port]</em> &gt;...&lt;/VirtualHost&gt;</a></dd>
</dl>
<dl><dt class="dlterm">Limit and LimitExcept</dt>
<dd><a href="rzaiemod_core.htm#limit">&lt;Limit <em>method
method</em>&gt;...&lt;/Limit&gt;</a> </dd>
<dd class="ddexpand"><a href="rzaiemod_core.htm#limitexcept">&lt;LimitExcept <em>method method</em>&gt;...&lt;/LimitExcept&gt;</a></dd>
</dl>
<div class="note"><span class="notetitle">Note:</span> Not all directives enclosed by brackets (&lt;&gt;) are container directives.
For example, directives <a href="rzaiemod_core.htm#ifmodule">&lt;IfModule&gt;</a> and <a href="rzaiemod_core.htm#ifdefine">&lt;IfDefine&gt;</a> are used to define parts of
the HTTP Server (powered by Apache) configuration that are conditional and
are ignored once the server has started; however, they are not directive containers.</div>
</div>
</div>
<div class="nested1" id="contextrelationship"><a name="contextrelationship"><!-- --></a><h2 class="topictitle2">Context and server area relationship</h2>
<div><p>The following table shows server area and context relationship.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="38.19095477386934%" id="d0e229">Server area</th>
<th valign="top" width="61.80904522613066%" id="d0e231">Context</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Global configuration</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">server config</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Directory container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (&lt;Directory&gt; or &lt;DirectoryMatch&gt;)</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">File container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (&lt;File&gt; or &lt;FileMatch&gt;)</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Location container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (&lt;Location&gt; or &lt;LocationMatch&gt;)</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Proxy container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (&lt;Proxy&gt; or &lt;ProxyMatch&gt;)</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Virtual host container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">virtual host (&lt;VirtualHost&gt;)</td>
</tr>
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Limit except container</td>
<td valign="top" width="61.80904522613066%" headers="d0e231 ">&lt;Limit&gt; or &lt;LimitExcept&gt;<div class="note"><span class="notetitle">Note:</span> The context depends
on the location of the &lt;Limit&gt; and &lt;LimitExcept&gt; container. It will
inherit the context of the area it is in. For example, if the &lt;Limit&gt; and
&lt;LimitExcept) are within a directory container, the &lt;Limit&gt; or &lt;LimitExcept&gt;
will be assigned the same values as the directory container.</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>See <a href="rzaiedirective.htm">Directives for HTTP Server</a> for more information
on all the supported HTTP Server (powered by Apache) directives and the context
in which the directives may be used.</p>
</div>
</div>
<div class="nested1" id="directivecontainers"><a name="directivecontainers"><!-- --></a><h2 class="topictitle2">Directives within containers</h2>
<div><p>The container directives &lt;Directory&gt;, &lt;Location&gt; and &lt;Files&gt; can
contain directives which only apply to specified directories, URLs or files
respectively. This also includes .htaccess files that can be used inside
a directory container to apply directives to that directory. </p>
<p>Files that are included in the configuration file are processed by the
HTTP Server (powered by Apache) at start time. Changes to files that are
included in the configuration file (such as include files and group files,
but not .htaccess files) do not take effect until the server is restarted.</p>
<p>Everything that is syntactically allowed in &lt;Directory&gt; is also allowed
in &lt;Location&gt; (except a sub-&lt;Files&gt; section). Semantically however
some things, and the most notable are AllowOverride and the two options FollowSymLinks
and SymLinksIfOwnerMatch, make no sense in &lt;Location&gt;, &lt;LocationMatch&gt;
or &lt;DirectoryMatch&gt;. The same for &lt;Files&gt; -- while syntactically correct,
they are semantically incorrect.</p>
</div>
<div class="nested2" xml:lang="en-us" id="directiveinheritance"><a name="directiveinheritance"><!-- --></a><h3 class="topictitle3">Directive inheritance</h3>
<div><p>Directives inherit first from the top most (or "parent") directive container,
then from more specific directive containers within.</p>
<dl><dt class="dlterm">Example:</dt>
<dd><pre>&lt;Directory A&gt;
directive a
&lt;Directory B&gt;
directive b
&lt;/Directory&gt;
&lt;/Directory&gt;</pre>
<p>In the above example, <var class="varname">Directory A</var> is
the parent container to <var class="varname">Directory B</var>. <var class="varname">Directive
b</var> first inherits its parameters from <var class="varname">Directory A</var> and
directive a by default. If the parameters for <var class="varname">directive b</var> are
defined, then <var class="varname">directive b</var> does not inherit, but uses its
own parameter settings.</p>
<p>In reverse, <var class="varname">directive a</var> does
not inherit any parameter settings from <var class="varname">directive b</var>, since <var class="varname">directive
a</var> is the parent to <var class="varname">directive b</var>. Inheritance only
goes from parent to child.</p>
</dd>
</dl>
<div class="note"><span class="notetitle">Note:</span> Best practice for security of your HTTP Server is to put all security
directives into each container to ensure that each directory or file is secured.</div>
</div>
</div>
</div>
<div class="nested1" id="merged"><a name="merged"><!-- --></a><h2 class="topictitle2">How the directives are merged </h2>
<div><p>The order of merging is: </p>
<ol><li>&lt;Directory&gt; (except regular expressions) and .htaccess done simultaneously
(with .htaccess overriding &lt;Directory&gt;) </li>
<li>&lt;DirectoryMatch&gt;, and &lt;Directory&gt; with regular expressions </li>
<li>&lt;Files&gt; and &lt;FilesMatch&gt; done simultaneously </li>
<li>&lt;Location&gt; and &lt;LocationMatch&gt; done simultaneously</li>
</ol>
<p>Apart from &lt;Directory&gt;, each directive group (directives within container
directives) is processed in the order that they appear in the configuration
files. &lt;Directory&gt; (directive group 1 above) is processed in the order
shortest directory component to longest. If multiple &lt;Directory&gt; sections
apply to the same directory they are processed in the configuration file
order. Configurations included through the Include directive will be treated
as if they were inside the including file at the location of the Include
directive. </p>
<p>Container directives inside a &lt;VirtualHost&gt; container directive are
applied after the corresponding directives outside of the virtual host definition.
This allows virtual hosts to override the main server configuration. </p>
</div>
</div>
<div class="nested1" id="using"><a name="using"><!-- --></a><h2 class="topictitle2">Using container directives</h2>
<div><p><strong>General guidelines:</strong></p>
<ul><li>If you are attempting to match objects at the file system level then you
must use the &lt;Directory&gt; and &lt;Files&gt; container directives. </li>
<li>If you are attempting to match objects at the URL level then you must
use the &lt;Location&gt; container directive.</li>
</ul>
<p><strong>Notable exception: </strong></p>
<ul><li>Proxy control is done via &lt;Proxy&gt; containers. Directives which are
valid in a &lt;Directory&gt; container are also valid in a &lt;Proxy&gt; container.
A &lt;Proxy&gt; container is very similar to a &lt;Location&gt; container, since
it deals with virtual paths and locations rather than with physical paths.
The directives in &lt;Proxy&gt; containers are processed after the directives
in &lt;Location&gt; containers are processed, but before directives in &lt;Directory&gt;
containers are processed. The directives in &lt;Proxy&gt; containers are also
inherited into more specific &lt;Proxy&gt; containers in the same way as the
directives in a &lt;Directory&gt; container. </li>
</ul>
<p><strong>.htaccess parsing:</strong></p>
<ul><li>Modifying .htaccess parsing within a &lt;Location&gt; container directive
has no affect. The .htaccess parsing has already occurred.</li>
</ul>
<p><strong>&lt;Location&gt; and symbolic links:</strong></p>
<ul><li>It is not possible to use Options FollowSymLinks or Options SymLinksIfOwnerMatch
inside a &lt;Location&gt;, &lt;LocationMatch&gt; or &lt;DirectoryMatch&gt; container
directives (the Options are simply ignored). Using the Options in question
is only possible inside a &lt;Directory&gt; container directive (or a .htaccess
file).</li>
</ul>
<p><strong>&lt;Files&gt; and Options:</strong></p>
<ul><li>Using an Options directive inside a &lt;Files&gt; container directive has
no effect. </li>
</ul>
<div class="note"><span class="notetitle">Note:</span> A &lt;Location&gt;/&lt;LocationMatch&gt; sequence is performed just before
the name translation phase (where Aliases and DocumentRoots are used to
map URLs to filenames). The results of this sequence are removed after the
translation has completed. </div>
</div>
</div>
</body>
</html>