<p>Using <code>none</code> for an argument will disable any accept filters
for that protocol. This is useful for protocols that require a server
send data first, such as <code>ftp:</code> or <code>nntp</code>:</p>
- <example>AcceptFilter nntp none</example>
+ <highlight language="config">
+AcceptFilter nntp none
+ </highlight>
<p>The default protocol names are <code>https</code> for port 443
and <code>http</code> for all other ports. To specify another protocol
directive.</p>
<p>The default values on FreeBSD are:</p>
- <example>
- AcceptFilter http httpready <br/>
- AcceptFilter https dataready
- </example>
+ <highlight language="config">
+AcceptFilter http httpready
+AcceptFilter https dataready
+ </highlight>
<p>The <code>httpready</code> accept filter buffers entire HTTP requests at
the kernel level. Once an entire request is received, the kernel then
accf_data(9)</a> filter is used.</p>
<p>The default values on Linux are:</p>
- <example>
- AcceptFilter http data <br/>
- AcceptFilter https data
- </example>
+ <highlight language="config">
+AcceptFilter http data
+AcceptFilter https data
+ </highlight>
<p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
requests. Any value besides <code>none</code> will enable
tcp(7)</a> man page.</p>
<p>The default values on Windows are:</p>
- <example>
- AcceptFilter http data <br/>
- AcceptFilter https data
- </example>
+ <highlight language="config">
+AcceptFilter http data
+AcceptFilter https data
+ </highlight>
<p>Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx()
API, and does not support http protocol buffering. There are two values
the request, so you can use the following configuration to enable
such a script:</p>
- <example>
- <Files "mypaths.shtml"><br />
- <indent>
- Options +Includes<br />
- SetOutputFilter INCLUDES<br />
- AcceptPathInfo On<br />
- </indent>
- </Files>
- </example>
+ <highlight language="config">
+<Files "mypaths.shtml">
+ Options +Includes<br />
+ SetOutputFilter INCLUDES<br />
+ AcceptPathInfo On<br />
+</Files>
+ </highlight>
</usage>
</directivesynopsis>
configuration files are <a href="#allowoverride">enabled for that
directory</a>. For example:</p>
- <example>
- AccessFileName .acl
- </example>
+ <highlight language="config">
+AccessFileName .acl
+ </highlight>
<p>before returning the document
<code>/usr/local/web/index.html</code>, the server will read
<code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
for directives, unless they have been disabled with</p>
- <example>
- <Directory /><br />
- <indent>
- AllowOverride None<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory /><br />
+ AllowOverride None<br />
+</Directory>
+ </highlight>
</usage>
<seealso><directive module="core">AllowOverride</directive></seealso>
<seealso><a href="../configuring.html">Configuration Files</a></seealso>
charset values</a> for use in Internet media types (MIME types).
For example:</p>
- <example>
- AddDefaultCharset utf-8
- </example>
+ <highlight language="config">
+AddDefaultCharset utf-8
+ </highlight>
<p><directive>AddDefaultCharset</directive> should only be used when all
of the text resources to which it applies are known to be in that
<p>Example:</p>
- <example>
- AllowOverride AuthConfig Indexes
- </example>
+ <highlight language="config">
+AllowOverride AuthConfig Indexes
+ </highlight>
<p>In the example above all directives that are neither in the group
<code>AuthConfig</code> nor <code>Indexes</code> cause an internal
<p>Example:</p>
- <example>
- AllowOverride None<br />
- AllowOverrideList Redirect RedirectMatch
- </example>
+ <highlight language="config">
+AllowOverride None
+AllowOverrideList Redirect RedirectMatch
+ </highlight>
<p>In the example above only the <code>Redirect</code> and
<code>RedirectMatch</code> directives are allowed. All others will
<p>Example:</p>
- <example>
- AllowOverride AuthConfig<br />
- AllowOverrideList CookieTracking CookieName
- </example>
+ <highlight language="config">
+AllowOverride AuthConfig
+AllowOverrideList CookieTracking CookieName
+ </highlight>
<p>In the example above <directive module="core">AllowOverride
</directive> grants permission to the <code>AuthConfig</code>
(shared memory, locks, etc.). If set as a relative path, the full path
will be relative to <directive>ServerRoot</directive></p>
- <example><title>Example</title>
- DefaultRuntimeDir scratch/
- </example>
+ <highlight language="config">
+<strong>Example</strong>
+DefaultRuntimeDir scratch/
+ </highlight>
<p>The default location of <directive>DefaultRuntimeDir</directive> may be
modified by changing the <code>DEFAULT_REL_RUNTIMEDIR</code> #define
of configuration files, it may be specified with the value
<code>none</code>, meaning no default media type. For example:</p>
- <example>
- DefaultType None
- </example>
+ <highlight language="config">
+DefaultType None
+ </highlight>
<p><code>DefaultType None</code> is only available in
httpd-2.2.7 and later.</p>
the <code>${VAR}</code> syntax. The variable is always globally defined
and not limited to the scope of the surrounding config section.</p>
- <example>
- <IfDefine TEST><br/>
- Define servername test.example.com<br/>
- </IfDefine><br/>
- <IfDefine !TEST><br/>
- Define servername www.example.com<br/>
- Define SSL<br/>
- </IfDefine><br/>
- </example>
+ <highlight language="config">
+<IfDefine TEST>
+ Define servername test.example.com
+</IfDefine>
+<IfDefine !TEST>
+ Define servername www.example.com
+ Define SSL
+</IfDefine>
+ </highlight>
<p>Variable names may not contain colon ":" characters, to avoid clashes
with <directive module="mod_rewrite">RewriteMap</directive>'s syntax.</p>
<code>/home/user/public_html</code>, but <code><Directory
/home/*/public_html></code> will match. Example:</p>
- <example>
- <Directory /usr/local/httpd/htdocs><br />
- <indent>
- Options Indexes FollowSymLinks<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/usr/local/httpd/htdocs">
+ Options Indexes FollowSymLinks
+</Directory>
+ </highlight>
<note>
<p>Be careful with the <var>directory-path</var> arguments:
expressions</glossary> can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <example>
- <Directory ~ "^/www/.*/[0-9]{3}">
- </example>
+ <highlight language="config">
+<Directory ~ "^/www/.*/[0-9]{3}">
+ </highlight>
<p>would match directories in <code>/www/</code> that consisted of
three numbers.</p>
href="#accessfilename">.htaccess</a> files. For example,
with</p>
- <example>
- <Directory /><br />
- <indent>
- AllowOverride None<br />
- </indent>
- </Directory><br />
- <br />
- <Directory /home><br />
- <indent>
- AllowOverride FileInfo<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory />
+ AllowOverride None
+</Directory>
+
+<Directory "/home">
+ AllowOverride FileInfo
+</Directory>
+ </highlight>
<p>for access to the document <code>/home/web/dir/doc.html</code>
the steps are:</p>
expressions are tested in the order they appeared in the
configuration file. For example, with</p>
- <example>
- <Directory ~ abc$><br />
- <indent>
- # ... directives here ...<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory ~ "abc$">
+# ... directives here ...
+</Directory>
+ </highlight>
<p>the regular expression section won't be considered until after
all normal <directive type="section">Directory</directive>s and
recommended that you change this with a block such
as</strong></p>
- <example>
- <Directory /><br />
- <indent>
- Require all denied<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory />
+ Require all denied
+</Directory>
+ </highlight>
<p><strong>and then override this for directories you
<em>want</em> accessible. See the <a
However, it takes as an argument a
<glossary ref="regex">regular expression</glossary>. For example:</p>
- <example>
- <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
- </example>
+ <highlight language="config">
+<DirectoryMatch "^/www/(.+/)?[0-9]{3}">
+ </highlight>
<p>would match directories in <code>/www/</code> that consisted of three
numbers.</p>
path from the requested URL to the document root to make the
path to the document. Example:</p>
- <example>
- DocumentRoot /usr/web
- </example>
+ <highlight language="config">
+DocumentRoot "/usr/web"
+ </highlight>
<p>then an access to
<code>http://my.example.com/index.html</code> refers to
in the same scope has not been applied.
For example: In </p>
- <example>
- <If "-z req('Host')"><br/>
- ...<br/>
- </If><br/>
- <Else><br/>
- ...<br/>
- </Else><br/>
- </example>
+ <highlight language="config">
+<If "-z req('Host')">
+# ...
+</If>
+<Else>
+# ...
+</Else>
+ </highlight>
<p> The <directive type="section">If</directive> would match HTTP/1.0
requests without a <var>Host:</var> header and the
<directive type="section">ElseIf</directive> section in the same scope has
not been applied. For example: In </p>
- <example>
- <If "-R '10.1.0.0/16'"><br/>
- ...<br/>
- </If><br/>
- <ElseIf "-R '10.0.0.0/8'"><br/>
- ...<br/>
- </ElseIf><br/>
- <Else><br/>
- ...<br/>
- </Else><br/>
- </example>
+ <highlight language="config">
+<If "-R '10.1.0.0/16'">
+#...
+</If>
+<ElseIf "-R '10.0.0.0/8'">
+#...
+</ElseIf>
+<Else>
+#...
+</Else>
+ </highlight>
<p>The <directive type="section">ElseIf</directive> would match if
the remote address of a request belongs to the subnet 10.0.0.0/8 but
<p>For server configurations that are vulnerable to these problems,
you should disable memory-mapping of delivered files by specifying:</p>
- <example>
- EnableMMAP Off
- </example>
+ <highlight language="config">
+EnableMMAP Off
+ </highlight>
<p>For NFS mounted files, this feature may be disabled explicitly for
the offending files by specifying:</p>
- <example>
- <Directory "/path-to-nfs-files">
- <indent>
- EnableMMAP Off
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/path-to-nfs-files">
+ EnableMMAP Off
+</Directory>
+ </highlight>
</usage>
</directivesynopsis>
<p>For server configurations that are not vulnerable to these problems,
you may enable this feature by specifying:</p>
- <example>
- EnableSendfile On
- </example>
+ <highlight language="config">
+EnableSendfile On
+ </highlight>
<p>For network mounted files, this feature may be disabled explicitly
for the offending files by specifying:</p>
- <example>
- <Directory "/path-to-nfs-files">
- <indent>
- EnableSendfile Off
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/path-to-nfs-files">
+ EnableSendfile Off
+</Directory>
+ </highlight>
<p>Please note that the per-directory and .htaccess configuration
of <directive>EnableSendfile</directive> is not supported by
<module>mod_cache_disk</module>.
configuration parsing. The typical use is for reporting required
modules which are missing from the configuration.</p>
- <example><title>Example</title>
- # ensure that mod_include is loaded<br />
- <IfModule !include_module><br />
- Error mod_include is required by mod_foo. Load it with LoadModule.<br />
- </IfModule><br />
- <br />
- # ensure that exactly one of SSL,NOSSL is defined<br />
- <IfDefine SSL><br />
- <IfDefine NOSSL><br />
- Error Both SSL and NOSSL are defined. Define only one of them.<br />
- </IfDefine><br />
- </IfDefine><br />
- <IfDefine !SSL><br />
- <IfDefine !NOSSL><br />
- Error Either SSL or NOSSL must be defined.<br />
- </IfDefine><br />
- </IfDefine><br />
- </example>
+ <highlight language="config">
+<strong>Example</strong>
+# ensure that mod_include is loaded
+<IfModule !include_module>
+ Error mod_include is required by mod_foo. Load it with LoadModule.
+</IfModule>
+
+# ensure that exactly one of SSL,NOSSL is defined
+<IfDefine SSL>
+<IfDefine NOSSL>
+ Error Both SSL and NOSSL are defined. Define only one of them.
+</IfDefine>
+</IfDefine>
+<IfDefine !SSL>
+<IfDefine !NOSSL>
+ Error Either SSL or NOSSL must be defined.
+</IfDefine>
+</IfDefine>
+ </highlight>
</usage>
</directivesynopsis>
full URL which the client can resolve. Alternatively, a message
can be provided to be displayed by the browser. Examples:</p>
- <example>
- ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
- ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
- ErrorDocument 401 /subscription_info.html<br />
- ErrorDocument 403 "Sorry can't allow you access today"<br />
- ErrorDocument 403 Forbidden!
- </example>
+ <highlight language="config">
+ErrorDocument 500 http://foo.example.com/cgi-bin/tester
+ErrorDocument 404 /cgi-bin/bad_urls.pl
+ErrorDocument 401 /subscription_info.html
+ErrorDocument 403 "Sorry can't allow you access today"
+ErrorDocument 403 Forbidden!
+ </highlight>
<p>Additionally, the special value <code>default</code> can be used
to specify Apache httpd's simple hardcoded message. While not required
Apache httpd's simple hardcoded message for configurations that would
otherwise inherit an existing <directive>ErrorDocument</directive>.</p>
- <example>
- ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
- <Directory /web/docs><br />
- <indent>
- ErrorDocument 404 default<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+ErrorDocument 404 /cgi-bin/bad_urls.pl
+
+
+<Directory /web/docs>
+ ErrorDocument 404 default
+</Directory>
+ </highlight>
<p>Note that when you specify an <directive>ErrorDocument</directive>
that points to a remote URL (ie. anything with a method such as
the <var>file-path</var> is not absolute then it is assumed to be
relative to the <directive module="core">ServerRoot</directive>.</p>
- <example><title>Example</title>
- ErrorLog /var/log/httpd/error_log
- </example>
+ <highlight language="config"><strong>Example</strong>
+ErrorLog "/var/log/httpd/error_log"
+ </highlight>
<p>If the <var>file-path</var>
begins with a pipe character "<code>|</code>" then it is assumed to be a
command to spawn to handle the error log.</p>
- <example><title>Example</title>
- ErrorLog "|/usr/local/bin/httpd_errors"
- </example>
+ <highlight language="config"><strong>Example</strong>
+ErrorLog "|/usr/local/bin/httpd_errors"
+ </highlight>
<p>See the notes on <a href="../logs.html#piped">piped logs</a> for
more information.</p>
in individual virtual hosts, the final facility specified affects the
entire server.</p>
- <example><title>Example</title>
- ErrorLog syslog:user
- </example>
+ <highlight language="config"><strong>Example</strong>
+ErrorLog syslog:user
+ </highlight>
<p>SECURITY: See the <a
href="../misc/security_tips.html#serverroot">security tips</a>
supplementary information is logged in the error log in addition to the
actual log message.</p>
- <example><title>Simple example</title>
- ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
- </example>
+ <highlight language="config"><strong>Simple example</strong>
+ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
+ </highlight>
<p>Specifying <code>connection</code> or <code>request</code> as first
parameter allows to specify additional formats, causing additional
with error log lines. If <module>mod_unique_id</module> is loaded, its
unique id will be used as log ID for requests.</p>
- <example><title>Example (default format)</title>
- ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a]
- %M% ,\ referer\ %{Referer}i"
- </example>
+ <highlight language="config"><strong>Example (default format)</strong>
+ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
+ </highlight>
<p>This would result in error messages such as:</p>
- <example>
+ <example>
[Thu May 12 08:28:57.652118 2011] [core:error] [pid 8777:tid 4326490112] [client ::1:58619] File does not exist: /usr/local/apache2/htdocs/favicon.ico
</example>
<p>Notice that, as discussed above, some fields are ommitted
entirely because they are not defined.</p>
- <example><title>Example (similar to the 2.2.x format)</title>
- ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
- %M% ,\ referer\ %{Referer}i"
- </example>
+ <highlight language="config"><strong>Example (similar to the 2.2.x format)</strong>
+ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
+ </highlight>
- <example><title>Advanced example with request/connection log IDs</title>
- ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br/>
- ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br/>
- ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br/>
- ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br/>
- ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br/>
- </example>
+ <highlight language="config"><strong>Advanced example with request/connection log IDs</strong>
+ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"
+ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"
+ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"
+ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"
+ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"
+ </highlight>
</usage>
<seealso><directive module="core">ErrorLog</directive></seealso>
<dd>The number of bytes in the file will be included</dd>
<dt><strong>All</strong></dt>
<dd>All available fields will be used. This is equivalent to:
- <example>FileETag INode MTime Size</example></dd>
+ <highlight language="config">FileETag INode MTime Size</highlight></dd>
<dt><strong>None</strong></dt>
<dd>If a document is file-based, no <code>ETag</code> field will be
included in the response</dd>
can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <example>
- <Files ~ "\.(gif|jpe?g|png)$">
- </example>
+ <highlight language="config">
+<Files ~ "\.(gif|jpe?g|png)$">
+ </highlight>
<p>would match most common Internet graphics formats. <directive
module="core" type="section">FilesMatch</directive> is preferred,
does. However, it accepts a <glossary ref="regex">regular
expression</glossary>. For example:</p>
- <example>
- <FilesMatch "\.(gif|jpe?g|png)$">
- </example>
+ <highlight language="config">
+<FilesMatch "\.(gif|jpe?g|png)$">
+ </highlight>
<p>would match most common Internet graphics formats.</p>
</usage>
GIF files, but did not want to label them all with <code>.gif</code>,
you might want to use:</p>
- <example>
- ForceType image/gif
- </example>
+ <highlight language="config">
+ForceType image/gif
+ </highlight>
<p>Note that this directive overrides other indirect media type
associations defined in mime.types or via the
<directive>ForceType</directive> settings
by using the value of <code>None</code>:</p>
- <example>
- # force all files to be image/gif:<br />
- <Location /images><br />
- <indent>
- ForceType image/gif<br />
- </indent>
- </Location><br />
- <br />
- # but normal mime-type associations here:<br />
- <Location /images/mixed><br />
- <indent>
- ForceType None<br />
- </indent>
- </Location>
- </example>
+ <highlight language="config">
+# force all files to be image/gif:
+<Location /images>
+ ForceType image/gif
+</Location>
+
+# but normal mime-type associations here:
+<Location /images/mixed>
+ ForceType None
+</Location>
+ </highlight>
<p>This directive primarily overrides the content types generated for
static files served out of the filesystem. For resources other than
directives if and only if the expression evaluates to true.
For example:</p>
- <example>
- <If "-z req('Host')">
- </example>
+ <highlight language="config">
+<If "-z req('Host')">
+ </highlight>
<p>would match HTTP/1.0 requests without a <var>Host:</var> header.
Expressions may contain various shell-like operators for string
and others (<code>-n</code>, <code>-z</code>, <code>-f</code>, ...).
It is also possible to use regular expressions, </p>
- <example>
- <If "%{QUERY_STRING} =~ /(delete|commit)=.*?elem/">
- </example>
+ <highlight language="config">
+<If "%{QUERY_STRING} =~ /(delete|commit)=.*?elem/">
+ </highlight>
<p>shell-like pattern matches and many other operations. These operations
can be done on request headers (<code>req</code>), environment variables
nest-able, which can be used to implement simple
multiple-parameter tests. Example:</p>
- <example>
- httpd -DReverseProxy -DUseCache -DMemCache ...<br />
- <br />
- # httpd.conf<br />
- <IfDefine ReverseProxy><br />
- <indent>
- LoadModule proxy_module modules/mod_proxy.so<br />
- LoadModule proxy_http_module modules/mod_proxy_http.so<br />
- <IfDefine UseCache><br />
- <indent>
- LoadModule cache_module modules/mod_cache.so<br />
- <IfDefine MemCache><br />
- <indent>
- LoadModule mem_cache_module modules/mod_mem_cache.so<br />
- </indent>
- </IfDefine><br />
- <IfDefine !MemCache><br />
- <indent>
- LoadModule cache_disk_module modules/mod_cache_disk.so<br />
- </indent>
- </IfDefine>
- </indent>
- </IfDefine>
- </indent>
- </IfDefine>
- </example>
+ <example>httpd -DReverseProxy -DUseCache -DMemCache ...</example>
+ <highlight language="config">
+<IfDefine ReverseProxy>
+ LoadModule proxy_module modules/mod_proxy.so
+ LoadModule proxy_http_module modules/mod_proxy_http.so
+ <IfDefine UseCache>
+ LoadModule cache_module modules/mod_cache.so
+ <IfDefine MemCache>
+ LoadModule mem_cache_module modules/mod_mem_cache.so
+ </IfDefine>
+ <IfDefine !MemCache>
+ LoadModule cache_disk_module modules/mod_cache_disk.so
+ </IfDefine>
+ </IfDefine>
+</IfDefine>
+ </highlight>
</usage>
</directivesynopsis>
<p>Examples:</p>
- <example>
+ <highlight language="config">
Include /usr/local/apache2/conf/ssl.conf<br />
Include /usr/local/apache2/conf/vhosts/*.conf
- </example>
+ </highlight>
<p>Or, providing paths relative to your <directive
module="core">ServerRoot</directive> directory:</p>
- <example>
- Include conf/ssl.conf<br />
- Include conf/vhosts/*.conf
- </example>
+ <highlight language="config">
+Include conf/ssl.conf
+Include conf/vhosts/*.conf
+ </highlight>
<p>Wildcards may be included in the directory or file portion of the
path. This example will fail if there is no subdirectory in conf/vhosts
that contains at least one *.conf file:</p>
- <example>
- Include conf/vhosts/*/*.conf
- </example>
+ <highlight language="config">
+Include conf/vhosts/*/*.conf
+ </highlight>
<p>Alternatively, the following command will just be ignored in case of
missing files or directories:</p>
- <example>
- IncludeOptional conf/vhosts/*/*.conf
- </example>
+ <highlight language="config">
+IncludeOptional conf/vhosts/*/*.conf
+ </highlight>
</usage>
only to the methods <code>POST</code>, <code>PUT</code>, and
<code>DELETE</code>, leaving all other methods unprotected:</p>
- <example>
- <Limit POST PUT DELETE><br />
- <indent>
- Require valid-user<br />
- </indent>
- </Limit>
- </example>
+ <highlight language="config">
+<Limit POST PUT DELETE>
+ Require valid-user
+</Limit>
+ </highlight>
<p>The method names listed can be one or more of: <code>GET</code>,
<code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
<code>Require group editors</code> directive will be ignored
in all cases:</p>
- <example>
- <LimitExcept GET>
- <indent>
- Require valid-user
- </indent>
- </LimitExcept><br />
- <Limit POST>
- <indent>
- Require group editors
- </indent>
- </Limit>
- </example>
+ <highlight language="config">
+<LimitExcept GET>
+ Require valid-user
+</LimitExcept>
+<Limit POST>
+ Require group editors
+</Limit>
+ </highlight>
</usage>
</directivesynopsis>
<p>For example:</p>
- <example>
- <LimitExcept POST GET><br />
- <indent>
- Require valid-user<br />
- </indent>
- </LimitExcept>
- </example>
+ <highlight language="config">
+<LimitExcept POST GET>
+ Require valid-user
+</LimitExcept>
+ </highlight>
</usage>
</directivesynopsis>
determines, how deep subrequests may be nested. If you specify only one
<var>number</var>, it will be assigned to both limits.</p>
- <example><title>Example</title>
- LimitInternalRecursion 5
- </example>
+ <highlight language="config"><strong>Example</strong>
+LimitInternalRecursion 5
+ </highlight>
</usage>
</directivesynopsis>
location, and wish to limit the size of the uploaded file to 100K,
you might use the following directive:</p>
- <example>
- LimitRequestBody 102400
- </example>
+ <highlight language="config">
+LimitRequestBody 102400
+ </highlight>
<note><p>For a full description of how this directive is interpreted by
proxy requests, see the <module>mod_proxy</module> documentation.</p>
<p>For example:</p>
- <example>
- LimitRequestFields 50
- </example>
+ <highlight language="config">
+LimitRequestFields 50
+ </highlight>
<note type="warning"><title>Warning</title>
<p> When name-based virtual hosting is used, the value for this
<p>For example:</p>
- <example>
- LimitRequestFieldSize 4094
- </example>
+ <highlight language="config">
+LimitRequestFieldSize 4094
+ </highlight>
<note>Under normal conditions, the value should not be changed from
the default. Also, you can't set this higher than 8190 without
<p>For example:</p>
- <example>
- LimitRequestLine 4094
- </example>
+ <highlight language="config">
+LimitRequestLine 4094
+ </highlight>
<note>Under normal conditions, the value should not be changed from
the default. Also, you can't set this higher than 8190 without
<p>Example:</p>
- <example>
- LimitXMLRequestBody 0
- </example>
+ <highlight language="config">
+LimitXMLRequestBody 0
+ </highlight>
</usage>
</directivesynopsis>
/private1, /private1/ and /private1/file.txt will have the enclosed
directives applied, but /private1other would not.
</p>
- <example>
- <Location /private1>
- ...
- </example>
+ <highlight language="config">
+<Location /private1>
+# ...
+ </highlight>
<p>
In the example below, where a trailing slash is used, requests to
/private2/ and /private2/file.txt will have the enclosed
directives applied, but /private2 and /private2other would not.
</p>
- <example>
- <Location /private2<em>/</em>>
- ...
- </example>
+ <highlight language="config">
+<Location /private2<em>/</em>>
+# ...
+ </highlight>
<note><title>When to use <directive
type="section">Location</directive></title>
can also be used, with the addition of the <code>~</code>
character. For example:</p>
- <example>
- <Location ~ "/(extra|special)/data">
- </example>
+ <highlight language="config">
+<Location ~ "/(extra|special)/data">
+ </highlight>
<p>would match URLs that contained the substring <code>/extra/data</code>
or <code>/special/data</code>. The directive <directive
directive. For example, to enable status requests, but allow them
only from browsers at <code>example.com</code>, you might use:</p>
- <example>
- <Location /status><br />
- <indent>
- SetHandler server-status<br />
- Require host example.com<br />
- </indent>
- </Location>
- </example>
+ <highlight language="config">
+<Location /status>
+ SetHandler server-status
+ Require host example.com
+</Location>
+ </highlight>
<note><title>Note about / (slash)</title>
<p>The slash character has special meaning depending on where in a
it takes a <glossary ref="regex">regular expression</glossary>
as an argument instead of a simple string. For example:</p>
- <example>
- <LocationMatch "/(extra|special)/data">
- </example>
+ <highlight language="config">
+<LocationMatch "/(extra|special)/data">
+ </highlight>
<p>would match URLs that contained the substring <code>/extra/data</code>
or <code>/special/data</code>.</p>
<p>For example:</p>
- <example>
- LogLevel notice
- </example>
+ <highlight language="config">
+LogLevel notice
+ </highlight>
<note><title>Note</title>
<p>When logging to a regular file messages of the level
as module specification. This means the following three specifications
are equivalent:</p>
- <example>
- LogLevel info ssl:warn<br />
- LogLevel info mod_ssl.c:warn<br />
- LogLevel info ssl_module:warn<br />
- </example>
+ <highlight language="config">
+LogLevel info ssl:warn
+LogLevel info mod_ssl.c:warn
+LogLevel info ssl_module:warn
+ </highlight>
<p>It is also possible to change the level per directory:</p>
- <example>
- LogLevel info<br />
- <Directory /usr/local/apache/htdocs/app><br />
- LogLevel debug<br />
- </Files>
- </example>
+ <highlight language="config">
+LogLevel info
+<Directory "/usr/local/apache/htdocs/app">
+ LogLevel debug
+</Directory>
+ </highlight>
<note>
Per directory loglevel configuration only affects messages that are
<p>For example:</p>
- <example>
- MaxKeepAliveRequests 500
- </example>
+ <highlight language="config">
+MaxKeepAliveRequests 500
+ </highlight>
</usage>
</directivesynopsis>
<code>/var/httpd/locks</code>. The mutex mechanism for all other mutexes
will be changed from the compiled-in default to <code>sysvsem</code>.</p>
- <example>
- Mutex sysvsem default<br />
- Mutex fcntl:/var/httpd/locks mpm-accept
- </example>
+ <highlight language="config">
+Mutex sysvsem default
+Mutex fcntl:/var/httpd/locks mpm-accept
+ </highlight>
</usage>
</directivesynopsis>
<p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
- <example>
- <Directory /web/docs><br />
- <indent>
- Options Indexes FollowSymLinks<br />
- </indent>
- </Directory><br />
- <br />
- <Directory /web/docs/spec><br />
- <indent>
- Options Includes<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/web/docs"><br />
+ Options Indexes FollowSymLinks<br />
+</Directory><br />
+
+<Directory "/web/docs/spec"><br />
+ Options Includes<br />
+</Directory>
+ </highlight>
<p>then only <code>Includes</code> will be set for the
<code>/web/docs/spec</code> directory. However if the second
<directive>Options</directive> directive uses the <code>+</code> and
<code>-</code> symbols:</p>
- <example>
- <Directory /web/docs><br />
- <indent>
- Options Indexes FollowSymLinks<br />
- </indent>
- </Directory><br />
- <br />
- <Directory /web/docs/spec><br />
- <indent>
- Options +Includes -Indexes<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/web/docs">
+ Options Indexes FollowSymLinks
+</Directory>
+
+<Directory "/web/docs/spec">
+ Options +Includes -Indexes
+</Directory>
+ </highlight>
<p>then the options <code>FollowSymLinks</code> and
<code>Includes</code> are set for the <code>/web/docs/spec</code>
<p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
- <example>
- Protocol https
- </example>
+ <highlight language="config">
+Protocol https
+ </highlight>
<p>You can also specify the protocol using the <directive module="mpm_common">Listen</directive> directive.</p>
</usage>
by the shebang line (first line, starting with <code>#!</code>) in the
script. On Win32 systems this line usually looks like:</p>
- <example>
- #!C:/Perl/bin/perl.exe
- </example>
+ <highlight language="perl">
+#!C:/Perl/bin/perl.exe
+ </highlight>
<p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
- <example>
- #!perl
- </example>
+ <highlight language="perl">
+#!perl
+ </highlight>
<p>Setting <code>ScriptInterpreterSource Registry</code> will
cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
<p>It may be worth setting up a dedicated address for this, e.g.</p>
- <example>
- ServerAdmin www-admin@foo.example.com
- </example>
+ <highlight language="config">
+ServerAdmin www-admin@foo.example.com
+ </highlight>
<p>as users do not always mention that they are talking about the
server!</p>
</usage>
href="../vhosts/name-based.html">name-based virtual hosts</a>. The
<directive>ServerAlias</directive> may include wildcards, if appropriate.</p>
- <example>
- <VirtualHost *:80><br />
- ServerName server.example.com<br />
- ServerAlias server server2.example.com server2<br />
- ServerAlias *.example.com<br />
- UseCanonicalName Off<br />
- # ...<br />
- </VirtualHost>
- </example>
+ <highlight language="config">
+<VirtualHost *:80>
+ServerName server.example.com
+ServerAlias server server2.example.com server2
+ServerAlias *.example.com
+UseCanonicalName Off
+# ...
+</VirtualHost>
+ </highlight>
<p>Name-based virtual hosts for the best-matching set of <directive
type="section" module="core">virtualhost</directive>s are processsed
and you wish the web server to be so identified, the following
directive should be used:</p>
- <example>
- ServerName www.example.com
- </example>
+ <highlight language="config">
+ServerName www.example.com
+ </highlight>
<p>The <directive>ServerName</directive> directive
may appear anywhere within the definition of a server. However,
module="mod_so">LoadModule</directive>, for example) are taken as
relative to this directory.</p>
- <example><title>Example</title>
- ServerRoot /home/httpd
- </example>
+ <highlight language="config"><strong>Example</strong>
+ServerRoot "/home/httpd"
+ </highlight>
<p>The default location of <directive>ServerRoot</directive> may be
modified by using the <code>--prefix</code> argument to
of extension, you might put the following into an
<code>.htaccess</code> file in that directory:</p>
- <example>
- SetHandler imap-file
- </example>
+ <highlight language="config">
+SetHandler imap-file
+ </highlight>
<p>Another example: if you wanted to have the server display a
status report whenever a URL of
<code>http://servername/status</code> was called, you might put
the following into <code>httpd.conf</code>:</p>
- <example>
- <Location /status><br />
- <indent>
- SetHandler server-status<br />
- </indent>
- </Location>
- </example>
+ <highlight language="config">
+<Location "/status">
+ SetHandler server-status
+</Location>
+ </highlight>
<p>You can override an earlier defined <directive>SetHandler</directive>
directive by using the value <code>None</code>.</p>
in the <code>/www/data/</code> directory for server-side
includes.</p>
- <example>
- <Directory /www/data/><br />
- <indent>
- SetOutputFilter INCLUDES<br />
- </indent>
- </Directory>
- </example>
+ <highlight language="config">
+<Directory "/www/data/">
+ SetOutputFilter INCLUDES
+</Directory>
+ </highlight>
<p>If more than one filter is specified, they must be separated
by semicolons in the order in which they should process the
</ul>
- <example><title>Example</title>
- <VirtualHost 10.1.2.3:80><br />
- <indent>
- ServerAdmin webmaster@host.example.com<br />
- DocumentRoot /www/docs/host.example.com<br />
- ServerName host.example.com<br />
- ErrorLog logs/host.example.com-error_log<br />
- TransferLog logs/host.example.com-access_log<br />
- </indent>
- </VirtualHost>
- </example>
+ <highlight language="config"><strong>Example</strong>
+<VirtualHost 10.1.2.3:80>
+ ServerAdmin webmaster@host.example.com
+ DocumentRoot /www/docs/host.example.com
+ ServerName host.example.com
+ ErrorLog logs/host.example.com-error_log
+ TransferLog logs/host.example.com-access_log
+</VirtualHost>
+ </highlight>
<p>IPv6 addresses must be specified in square brackets because
the optional port number could not be determined otherwise. An
IPv6 example is shown below:</p>
- <example>
- <VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80><br />
- <indent>
- ServerAdmin webmaster@host.example.com<br />
- DocumentRoot /www/docs/host.example.com<br />
- ServerName host.example.com<br />
- ErrorLog logs/host.example.com-error_log<br />
- TransferLog logs/host.example.com-access_log<br />
- </indent>
- </VirtualHost>
- </example>
+ <highlight language="config">
+<VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80>
+ ServerAdmin webmaster@host.example.com
+ DocumentRoot /www/docs/host.example.com
+ ServerName host.example.com
+ ErrorLog logs/host.example.com-error_log
+ TransferLog logs/host.example.com-access_log
+</VirtualHost>
+ </highlight>
<p>Each Virtual Host must correspond to a different IP address,
different port number or a different host name for the server,