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>
<highlight language="config">
-AcceptFilter nntp none
+ AcceptFilter nntp none
</highlight>
<p>The default protocol names are <code>https</code> for port 443
<highlight language="config">
<Files "mypaths.shtml">
- Options +Includes<br />
- SetOutputFilter INCLUDES<br />
- AcceptPathInfo On<br />
+ Options +Includes
+ SetOutputFilter INCLUDES
+ AcceptPathInfo On
</Files>
</highlight>
configuration files are <a href="#allowoverride">enabled for that
directory</a>. For example:</p>
- <highlight language="config">
-AccessFileName .acl
- </highlight>
+ <highlight language="config">AccessFileName .acl</highlight>
<p>before returning the document
<code>/usr/local/web/index.html</code>, the server will read
for directives, unless they have been disabled with</p>
<highlight language="config">
-<Directory /><br />
- AllowOverride None<br />
+<Directory />
+ AllowOverride None
</Directory>
</highlight>
</usage>
charset values</a> for use in Internet media types (MIME types).
For example:</p>
- <highlight language="config">
-AddDefaultCharset utf-8
- </highlight>
+ <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>
- <highlight language="config">
-AllowOverride AuthConfig Indexes
- </highlight>
+ <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
will be relative to <directive>ServerRoot</directive></p>
<highlight language="config">
-<strong>Example</strong>
+#Example
DefaultRuntimeDir scratch/
</highlight>
of configuration files, it may be specified with the value
<code>none</code>, meaning no default media type. For example:</p>
- <highlight language="config">
-DefaultType None
- </highlight>
+ <highlight language="config">DefaultType None</highlight>
<p><code>DefaultType None</code> is only available in
httpd-2.2.7 and later.</p>
expressions</glossary> can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <highlight language="config">
-<Directory ~ "^/www/.*/[0-9]{3}">
- </highlight>
+ <highlight language="config"><Directory ~ "^/www/.*/[0-9]{3}"></highlight>
<p>would match directories in <code>/www/</code> that consisted of
three numbers.</p>
However, it takes as an argument a
<glossary ref="regex">regular expression</glossary>. For example:</p>
- <highlight language="config">
-<DirectoryMatch "^/www/(.+/)?[0-9]{3}">
- </highlight>
+ <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>
- <highlight language="config">
-DocumentRoot "/usr/web"
- </highlight>
+ <highlight language="config">DocumentRoot "/usr/web"</highlight>
<p>then an access to
<code>http://my.example.com/index.html</code> refers to
<p>For server configurations that are vulnerable to these problems,
you should disable memory-mapping of delivered files by specifying:</p>
- <highlight language="config">
-EnableMMAP Off
- </highlight>
+ <highlight language="config">EnableMMAP Off</highlight>
<p>For NFS mounted files, this feature may be disabled explicitly for
the offending files by specifying:</p>
<p>For server configurations that are not vulnerable to these problems,
you may enable this feature by specifying:</p>
- <highlight language="config">
-EnableSendfile On
- </highlight>
+ <highlight language="config">EnableSendfile On</highlight>
<p>For network mounted files, this feature may be disabled explicitly
for the offending files by specifying:</p>
modules which are missing from the configuration.</p>
<highlight language="config">
-<strong>Example</strong>
+# Example
# ensure that mod_include is loaded
<IfModule !include_module>
Error mod_include is required by mod_foo. Load it with LoadModule.
<highlight language="config">
ErrorDocument 404 /cgi-bin/bad_urls.pl
-
<Directory /web/docs>
ErrorDocument 404 default
</Directory>
the <var>file-path</var> is not absolute then it is assumed to be
relative to the <directive module="core">ServerRoot</directive>.</p>
- <highlight language="config"><strong>Example</strong>
-ErrorLog "/var/log/httpd/error_log"
- </highlight>
+ <highlight language="config">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>
- <highlight language="config"><strong>Example</strong>
-ErrorLog "|/usr/local/bin/httpd_errors"
- </highlight>
+ <highlight language="config">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>
- <highlight language="config"><strong>Example</strong>
-ErrorLog syslog:user
- </highlight>
+ <highlight language="config">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>
- <highlight language="config"><strong>Simple example</strong>
+ <highlight language="config">
+#Simple example
ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
</highlight>
with error log lines. If <module>mod_unique_id</module> is loaded, its
unique id will be used as log ID for requests.</p>
- <highlight language="config"><strong>Example (default format)</strong>
+ <highlight language="config">
+#Example (default format)
ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
</highlight>
<p>Notice that, as discussed above, some fields are ommitted
entirely because they are not defined.</p>
- <highlight language="config"><strong>Example (similar to the 2.2.x format)</strong>
+ <highlight language="config">
+#Example (similar to the 2.2.x format)
ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
</highlight>
- <highlight language="config"><strong>Advanced example with request/connection log IDs</strong>
+ <highlight language="config">
+#Advanced example with request/connection log IDs
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'"
can also be used, with the addition of the
<code>~</code> character. For example:</p>
- <highlight language="config">
-<Files ~ "\.(gif|jpe?g|png)$">
- </highlight>
+ <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>
- <highlight language="config">
-<FilesMatch "\.(gif|jpe?g|png)$">
- </highlight>
+ <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>
- <highlight language="config">
-ForceType image/gif
- </highlight>
+ <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
directives if and only if the expression evaluates to true.
For example:</p>
- <highlight language="config">
-<If "-z req('Host')">
- </highlight>
+ <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>
- <highlight language="config">
-<If "%{QUERY_STRING} =~ /(delete|commit)=.*?elem/">
- </highlight>
+ <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
<p>Examples:</p>
<highlight language="config">
- Include /usr/local/apache2/conf/ssl.conf<br />
- Include /usr/local/apache2/conf/vhosts/*.conf
+Include /usr/local/apache2/conf/ssl.conf
+Include /usr/local/apache2/conf/vhosts/*.conf
</highlight>
<p>Or, providing paths relative to your <directive
path. This example will fail if there is no subdirectory in conf/vhosts
that contains at least one *.conf file:</p>
- <highlight language="config">
-Include conf/vhosts/*/*.conf
- </highlight>
+ <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>
- <highlight language="config">
-IncludeOptional conf/vhosts/*/*.conf
- </highlight>
+ <highlight language="config">IncludeOptional conf/vhosts/*/*.conf</highlight>
</usage>
determines, how deep subrequests may be nested. If you specify only one
<var>number</var>, it will be assigned to both limits.</p>
- <highlight language="config"><strong>Example</strong>
-LimitInternalRecursion 5
- </highlight>
+ <highlight language="config">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>
- <highlight language="config">
-LimitRequestBody 102400
- </highlight>
+ <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>
- <highlight language="config">
-LimitRequestFields 50
- </highlight>
+ <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>
- <highlight language="config">
-LimitRequestFieldSize 4094
- </highlight>
+ <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>
- <highlight language="config">
-LimitRequestLine 4094
- </highlight>
+ <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>
- <highlight language="config">
-LimitXMLRequestBody 0
- </highlight>
+ <highlight language="config">LimitXMLRequestBody 0</highlight>
</usage>
</directivesynopsis>
can also be used, with the addition of the <code>~</code>
character. For example:</p>
- <highlight language="config">
-<Location ~ "/(extra|special)/data">
- </highlight>
+ <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
it takes a <glossary ref="regex">regular expression</glossary>
as an argument instead of a simple string. For example:</p>
- <highlight language="config">
-<LocationMatch "/(extra|special)/data">
- </highlight>
+ <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>
- <highlight language="config">
-LogLevel notice
- </highlight>
+ <highlight language="config">LogLevel notice</highlight>
<note><title>Note</title>
<p>When logging to a regular file messages of the level
<p>For example:</p>
- <highlight language="config">
-MaxKeepAliveRequests 500
- </highlight>
+ <highlight language="config">MaxKeepAliveRequests 500</highlight>
</usage>
</directivesynopsis>
<p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
<highlight language="config">
-<Directory "/web/docs"><br />
- Options Indexes FollowSymLinks<br />
-</Directory><br />
+<Directory "/web/docs">
+ Options Indexes FollowSymLinks
+</Directory>
-<Directory "/web/docs/spec"><br />
- Options Includes<br />
+<Directory "/web/docs/spec">
+ Options Includes
</Directory>
</highlight>
<p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
- <highlight language="config">
-Protocol https
- </highlight>
+ <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>
- <highlight language="perl">
-#!C:/Perl/bin/perl.exe
- </highlight>
+ <highlight language="perl">#!C:/Perl/bin/perl.exe</highlight>
<p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
- <highlight language="perl">
-#!perl
- </highlight>
+ <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>
- <highlight language="config">
-ServerAdmin www-admin@foo.example.com
- </highlight>
+ <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>
and you wish the web server to be so identified, the following
directive should be used:</p>
- <highlight language="config">
-ServerName www.example.com
- </highlight>
+ <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>
- <highlight language="config"><strong>Example</strong>
-ServerRoot "/home/httpd"
- </highlight>
+ <highlight language="config">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>
- <highlight language="config">
-SetHandler imap-file
- </highlight>
+ <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