294 lines
19 KiB
HTML
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 <Directory> 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 <Directory> containers. If the directive supports this context, the
|
|
directive can be used in most containers (<Directory>, <File>, <Proxy>,
|
|
and <Location> 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 <Virtual Host> 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 (>) and lesser than (<) brackets. For example, <Directory>
|
|
is a container directive. Each container is comprised of an opening directive,
|
|
such as <Directory>, and closed with the same context directive prefixed
|
|
with a slash (/). For example, </Directory>. </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"><Directory <em>directory</em>>...</Directory></a></dd>
|
|
<dd class="ddexpand"><a href="rzaiemod_core.htm#directorymatch"><DirectoryMatch <em>regex</em>>...</DirectoryMatch> </a></dd>
|
|
</dl>
|
|
<dl><dt class="dlterm">Files and FilesMatch</dt>
|
|
<dd><a href="rzaiemod_core.htm#files"><Files <em>filename</em>>...</Files></a> </dd>
|
|
<dd class="ddexpand"><a href="rzaiemod_core.htm#filesmatch"><FilesMatch <em>regex</em>>...</FilesMatch></a></dd>
|
|
</dl>
|
|
<dl><dt class="dlterm">Location and LocationMatch</dt>
|
|
<dd><a href="rzaiemod_core.htm#location"><Location <em>URL</em>>...</Location> </a></dd>
|
|
<dd class="ddexpand"><a href="rzaiemod_core.htm#locationmatch"><LocationMatch <em>regex</em>>...</LocationMatch></a></dd>
|
|
</dl>
|
|
<dl><dt class="dlterm">Proxy and ProxyMatch</dt>
|
|
<dd><a href="rzaiemod_proxy.htm#proxy"><Proxy <em>criteria</em>>...</Proxy></a></dd>
|
|
<dd class="ddexpand"><a href="rzaiemod_proxy.htm#proxymatch"><ProxyMatch <em>regex</em>>...</ProxyMatch></a></dd>
|
|
</dl>
|
|
<dl><dt class="dlterm">VirtualHost</dt>
|
|
<dd><a href="rzaiemod_core.htm#virtualhost"><VirtualHost <em>addr[:port]</em> >...</VirtualHost></a></dd>
|
|
</dl>
|
|
<dl><dt class="dlterm">Limit and LimitExcept</dt>
|
|
<dd><a href="rzaiemod_core.htm#limit"><Limit <em>method
|
|
method</em>>...</Limit></a> </dd>
|
|
<dd class="ddexpand"><a href="rzaiemod_core.htm#limitexcept"><LimitExcept <em>method method</em>>...</LimitExcept></a></dd>
|
|
</dl>
|
|
<div class="note"><span class="notetitle">Note:</span> Not all directives enclosed by brackets (<>) are container directives.
|
|
For example, directives <a href="rzaiemod_core.htm#ifmodule"><IfModule></a> and <a href="rzaiemod_core.htm#ifdefine"><IfDefine></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 (<Directory> or <DirectoryMatch>)</td>
|
|
</tr>
|
|
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">File container</td>
|
|
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (<File> or <FileMatch>)</td>
|
|
</tr>
|
|
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Location container</td>
|
|
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (<Location> or <LocationMatch>)</td>
|
|
</tr>
|
|
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Proxy container</td>
|
|
<td valign="top" width="61.80904522613066%" headers="d0e231 ">directory (<Proxy> or <ProxyMatch>)</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 (<VirtualHost>)</td>
|
|
</tr>
|
|
<tr><td valign="top" width="38.19095477386934%" headers="d0e229 ">Limit except container</td>
|
|
<td valign="top" width="61.80904522613066%" headers="d0e231 "><Limit> or <LimitExcept><div class="note"><span class="notetitle">Note:</span> The context depends
|
|
on the location of the <Limit> and <LimitExcept> container. It will
|
|
inherit the context of the area it is in. For example, if the <Limit> and
|
|
<LimitExcept) are within a directory container, the <Limit> or <LimitExcept>
|
|
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 <Directory>, <Location> and <Files> 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 <Directory> is also allowed
|
|
in <Location> (except a sub-<Files> section). Semantically however
|
|
some things, and the most notable are AllowOverride and the two options FollowSymLinks
|
|
and SymLinksIfOwnerMatch, make no sense in <Location>, <LocationMatch>
|
|
or <DirectoryMatch>. The same for <Files> -- 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><Directory A>
|
|
directive a
|
|
<Directory B>
|
|
directive b
|
|
</Directory>
|
|
</Directory></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><Directory> (except regular expressions) and .htaccess done simultaneously
|
|
(with .htaccess overriding <Directory>) </li>
|
|
<li><DirectoryMatch>, and <Directory> with regular expressions </li>
|
|
<li><Files> and <FilesMatch> done simultaneously </li>
|
|
<li><Location> and <LocationMatch> done simultaneously</li>
|
|
</ol>
|
|
<p>Apart from <Directory>, each directive group (directives within container
|
|
directives) is processed in the order that they appear in the configuration
|
|
files. <Directory> (directive group 1 above) is processed in the order
|
|
shortest directory component to longest. If multiple <Directory> 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 <VirtualHost> 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 <Directory> and <Files> container directives. </li>
|
|
<li>If you are attempting to match objects at the URL level then you must
|
|
use the <Location> container directive.</li>
|
|
</ul>
|
|
<p><strong>Notable exception: </strong></p>
|
|
<ul><li>Proxy control is done via <Proxy> containers. Directives which are
|
|
valid in a <Directory> container are also valid in a <Proxy> container.
|
|
A <Proxy> container is very similar to a <Location> container, since
|
|
it deals with virtual paths and locations rather than with physical paths.
|
|
The directives in <Proxy> containers are processed after the directives
|
|
in <Location> containers are processed, but before directives in <Directory>
|
|
containers are processed. The directives in <Proxy> containers are also
|
|
inherited into more specific <Proxy> containers in the same way as the
|
|
directives in a <Directory> container. </li>
|
|
</ul>
|
|
<p><strong>.htaccess parsing:</strong></p>
|
|
<ul><li>Modifying .htaccess parsing within a <Location> container directive
|
|
has no affect. The .htaccess parsing has already occurred.</li>
|
|
</ul>
|
|
<p><strong><Location> and symbolic links:</strong></p>
|
|
<ul><li>It is not possible to use Options FollowSymLinks or Options SymLinksIfOwnerMatch
|
|
inside a <Location>, <LocationMatch> or <DirectoryMatch> container
|
|
directives (the Options are simply ignored). Using the Options in question
|
|
is only possible inside a <Directory> container directive (or a .htaccess
|
|
file).</li>
|
|
</ul>
|
|
<p><strong><Files> and Options:</strong></p>
|
|
<ul><li>Using an Options directive inside a <Files> container directive has
|
|
no effect. </li>
|
|
</ul>
|
|
<div class="note"><span class="notetitle">Note:</span> A <Location>/<LocationMatch> 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> |