You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ig...@apache.org on 2012/04/25 16:13:36 UTC
svn commit: r1330302 - /httpd/httpd/trunk/docs/manual/mod/core.xml
Author: igalic
Date: Wed Apr 25 14:13:36 2012
New Revision: 1330302
URL: http://svn.apache.org/viewvc?rev=1330302&view=rev
Log:
fixup examples in core.xml with syntax highlighting
Modified:
httpd/httpd/trunk/docs/manual/mod/core.xml
Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=1330302&r1=1330301&r2=1330302&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Wed Apr 25 14:13:36 2012
@@ -48,7 +48,9 @@ On Windows from Apache httpd 2.3.3 and l
<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
@@ -57,10 +59,10 @@ On Windows from Apache httpd 2.3.3 and l
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
@@ -71,10 +73,10 @@ On Windows from Apache httpd 2.3.3 and l
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
@@ -84,10 +86,10 @@ On Windows from Apache httpd 2.3.3 and l
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
@@ -170,15 +172,13 @@ On Windows from Apache httpd 2.3.3 and l
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>
@@ -198,9 +198,9 @@ On Windows from Apache httpd 2.3.3 and l
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
@@ -208,13 +208,11 @@ On Windows from Apache httpd 2.3.3 and l
<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>
@@ -247,9 +245,9 @@ content-type is <code>text/plain</code>
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
@@ -460,9 +458,9 @@ NoDecode option available in 2.3.12 and
<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
@@ -514,10 +512,10 @@ NoDecode option available in 2.3.12 and
<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
@@ -525,10 +523,10 @@ NoDecode option available in 2.3.12 and
<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>
@@ -617,9 +615,10 @@ headers</description>
(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
@@ -655,9 +654,9 @@ which no other media type configuration
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>
@@ -692,15 +691,15 @@ which no other media type configuration
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>
@@ -732,13 +731,11 @@ named file-system directory, sub-directo
<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:
@@ -753,9 +750,9 @@ named file-system directory, sub-directo
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>
@@ -768,19 +765,15 @@ named file-system directory, sub-directo
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>
@@ -802,13 +795,11 @@ named file-system directory, sub-directo
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
@@ -823,13 +814,11 @@ named file-system directory, sub-directo
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
@@ -865,9 +854,9 @@ the contents of file-system directories
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>
@@ -911,9 +900,9 @@ from the web</description>
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
@@ -948,14 +937,14 @@ satisfied by a request at runtime</descr
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
@@ -993,17 +982,17 @@ satisfied</description>
<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
@@ -1058,20 +1047,18 @@ for a complete reference and more exampl
<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>
@@ -1118,20 +1105,18 @@ version 2.3.9.</compatibility>
<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>.
@@ -1156,24 +1141,25 @@ version 2.3.9.</compatibility>
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>
@@ -1215,13 +1201,13 @@ in case of an error</description>
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
@@ -1229,14 +1215,14 @@ in case of an error</description>
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
@@ -1296,17 +1282,17 @@ in case of an error</description>
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>
@@ -1320,9 +1306,9 @@ in case of an error</description>
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>
@@ -1353,9 +1339,9 @@ in case of an error</description>
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
@@ -1519,32 +1505,30 @@ in case of an error</description>
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>
-
- <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>Example (similar to the 2.2.x format)</strong>
+ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
+ </highlight>
+
+ <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>
@@ -1619,7 +1603,7 @@ earlier.</compatibility>
<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>
@@ -1690,9 +1674,9 @@ filenames</description>
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,
@@ -1728,9 +1712,9 @@ filenames</description>
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>
@@ -1761,9 +1745,9 @@ media type in the HTTP Content-Type head
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
@@ -1773,21 +1757,17 @@ media type in the HTTP Content-Type head
<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
@@ -1877,9 +1857,9 @@ satisfied by a request at runtime</descr
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
@@ -1888,9 +1868,9 @@ satisfied by a request at runtime</descr
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
@@ -1955,32 +1935,22 @@ if a test is true at startup</descriptio
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>
@@ -2077,33 +2047,33 @@ wildcard matching available in 2.3.6 and
<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>
@@ -2226,13 +2196,11 @@ methods</description>
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>,
@@ -2272,18 +2240,14 @@ methods</description>
<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>
@@ -2310,13 +2274,11 @@ except the named ones</description>
<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>
@@ -2350,9 +2312,9 @@ subrequests</description>
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>
@@ -2395,9 +2357,9 @@ from the client</description>
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>
@@ -2440,9 +2402,9 @@ will be accepted from the client</descri
<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
@@ -2481,9 +2443,9 @@ client</description>
<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
@@ -2525,9 +2487,9 @@ from the client</description>
<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
@@ -2557,9 +2519,9 @@ from the client</description>
<p>Example:</p>
- <example>
- LimitXMLRequestBody 0
- </example>
+ <highlight language="config">
+LimitXMLRequestBody 0
+ </highlight>
</usage>
</directivesynopsis>
@@ -2610,19 +2572,19 @@ URLs</description>
/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>
@@ -2651,9 +2613,9 @@ URLs</description>
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
@@ -2669,14 +2631,12 @@ URLs</description>
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
@@ -2722,9 +2682,9 @@ matching URLs</description>
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>
@@ -2901,9 +2861,9 @@ matching URLs</description>
<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
@@ -2920,20 +2880,20 @@ matching URLs</description>
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
@@ -2963,9 +2923,9 @@ connection</description>
<p>For example:</p>
- <example>
- MaxKeepAliveRequests 500
- </example>
+ <highlight language="config">
+MaxKeepAliveRequests 500
+ </highlight>
</usage>
</directivesynopsis>
@@ -3288,10 +3248,10 @@ or specified mutexes</description>
<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>
@@ -3439,38 +3399,30 @@ directory</description>
<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>
@@ -3505,9 +3457,9 @@ On Windows from Apache 2.3.3 and later.<
<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>
@@ -3643,15 +3595,15 @@ later</compatibility>
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
@@ -3747,9 +3699,9 @@ messages sent to the client</description
<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>
@@ -3768,15 +3720,15 @@ to name-virtual hosts</description>
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
@@ -3814,9 +3766,9 @@ itself</description>
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,
@@ -3908,9 +3860,9 @@ is accessed by an incompatible browser</
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
@@ -4050,22 +4002,20 @@ handler</description>
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>
@@ -4127,13 +4077,11 @@ server</description>
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
@@ -4374,34 +4322,30 @@ hostname or IP address</description>
</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,