This topic provides information on the fundamental directive, context, and server area concepts on HTTP Server (powered by Apache).
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.
With the HTTP Server (powered by Apache), the directives are extensive, functional, and built around the concept of context.
The HTTP Server (powered by Apache) directives may be categorized into two main groups. These are Assignment directives and Container directives.
Understanding the context concept is necessary to increase the productivity and usefulness of your HTTP Server (powered by Apache). The IBM® Web Administration for i5/OS™ interface 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.
These types of directive contexts are supported:
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>.
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).
The following table shows server area and context relationship.
Server area | Context |
---|---|
Global configuration | server config |
Directory container | directory (<Directory> or <DirectoryMatch>) |
File container | directory (<File> or <FileMatch>) |
Location container | directory (<Location> or <LocationMatch>) |
Proxy container | directory (<Proxy> or <ProxyMatch>) |
Virtual host container | virtual host (<VirtualHost>) |
Limit except container | <Limit> or <LimitExcept> Note: 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.
|
See Directives for HTTP Server for more information on all the supported HTTP Server (powered by Apache) directives and the context in which the directives may be used.
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.
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.
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.
Directives inherit first from the top most (or "parent") directive container, then from more specific directive containers within.
<Directory A> directive a <Directory B> directive b </Directory> </Directory>
In the above example, Directory A is the parent container to Directory B. Directive b first inherits its parameters from Directory A and directive a by default. If the parameters for directive b are defined, then directive b does not inherit, but uses its own parameter settings.
In reverse, directive a does not inherit any parameter settings from directive b, since directive a is the parent to directive b. Inheritance only goes from parent to child.
The order of merging is:
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.
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.
General guidelines:
Notable exception:
.htaccess parsing:
<Location> and symbolic links:
<Files> and Options: