</dl>
<example><title>Example</title>
+ <highlight language="config">
Group www-group
+ </highlight>
</example>
<p>It is recommended that you set up a new group specifically for
<p>To allow a few users to have <code>UserDir</code> directories, but
not anyone else, use the following:</p>
- <example>
- UserDir disabled<br />
- UserDir enabled user1 user2 user3
- </example>
+ <highlight language="config">
+UserDir disabled
+UserDir enabled user1 user2 user3
+ </highlight>
<p>To allow most users to have <code>UserDir</code> directories, but
deny this to a few, use the following:</p>
- <example>
+ <highlight language="config">
UserDir disabled user4 user5 user6
- </example>
+ </highlight>
<p>It is also possible to specify alternative user directories.
If you use a command like:</p>
- <example>
- Userdir public_html /usr/web http://www.example.com/
- </example>
+ <highlight language="config">
+ UserDir public_html /usr/web http://www.example.com/
+ </highlight>
<p>With a request for
<code>http://www.example.com/~bob/one/two.html</code>, will try to
<p><module>mod_usertrack</module> sets a cookie which can be logged
via <module>mod_log_config</module> configurable logging formats:</p>
- <example>
- LogFormat "%{Apache}n %r %t" usertrack<br />
- CustomLog logs/clickstream.log usertrack
- </example>
+ <highlight language="config">
+LogFormat "%{Apache}n %r %t" usertrack
+CustomLog logs/clickstream.log usertrack
+ </highlight>
</section>
level domain (for example <code>.example.co.uk</code>).
</note>
- <example>
+ <highlight language="config">
CookieDomain .example.com
- </example>
+ </highlight>
</usage>
</directivesynopsis>
<p>If this directive is not used, cookies last only for the
current browser session.</p>
- <example>
+ <highlight language="config">
CookieExpires "3 weeks"
- </example>
+ </highlight>
</usage>
</directivesynopsis>
unpredictable if you use a name containing unusual characters.
Valid characters include A-Z, a-z, 0-9, "_", and "-".</p>
- <example>
+ <highlight language="config">
CookieName clicktrack
- </example>
+ </highlight>
</usage>
</directivesynopsis>
three of these formats, with <code>Cookie2</code> being the
preferred format.</p>
- <example>
+ <highlight language="config">
CookieStyle Cookie2
- </example>
+ </highlight>
</usage>
</directivesynopsis>
<module>mod_usertrack</module> will <strong>not</strong>
activate cookies. </p>
- <example>
+ <highlight language="config">
CookieTracking on
- </example>
+ </highlight>
</usage>
</directivesynopsis>
regular expressions.</p>
<example><title>Examples</title>
- <IfVersion 2.1.0><br />
- <indent>
- # current httpd version is exactly 2.1.0<br />
- </indent>
- </IfVersion><br />
- <br />
- <IfVersion >= 2.2><br />
- <indent>
- # use really new features :-)<br />
- </indent>
- </IfVersion>
+ <highlight language="config">
+<IfVersion 2.4.2>
+ # current httpd version is exactly 2.4.2
+</IfVersion>
+
+<IfVersion >= 2.5>
+ # use really new features :-)
+</IfVersion>
+ </highlight>
</example>
<p>See below for further possibilities.</p>
</table>
<example><title>Example</title>
- <IfVersion >= 2.1><br />
- <indent>
- # this happens only in versions greater or<br />
- # equal 2.1.0.<br />
- </indent>
- </IfVersion>
+ <highlight language="config">
+<IfVersion >= 2.3>
+ # this happens only in versions greater or
+ # equal 2.3.0.
+</IfVersion>
+ </highlight>
</example>
<p>Besides the numerical comparison it is possible to match a
</table>
<example><title>Example</title>
- <IfVersion = /^2.1.[01234]$/><br />
- <indent>
- # e.g. workaround for buggy versions
- </indent>
- </IfVersion>
+ <highlight language="config">
+<IfVersion = /^2.4.[01234]$/>
+ # e.g. workaround for buggy versions
+</IfVersion>
+ </highlight>
</example>
<p>In order to reverse the meaning, all operators can be preceded by an
exclamation mark (<code>!</code>):</p>
- <example>
- <IfVersion !~ ^2.1.[01234]$><br />
- <indent>
- # not for those versions<br />
- </indent>
- </IfVersion>
- </example>
+ <highlight language="config">
+<IfVersion !~ ^2.4.[01234]$>
+ # not for those versions
+</IfVersion>
+ </highlight>
<p>If the <var>operator</var> is omitted, it is assumed to be
<code>=</code>.</p>
/cgi-bin/script.pl</code> to <code>
/usr/local/apache2/cgi-bin/script.pl</code> in all cases:</p>
- <example>
- ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/<br />
- VirtualScriptAlias /never/found/%0/cgi-bin/
- </example>
+ <highlight language="config">
+ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/
+VirtualScriptAlias /never/found/%0/cgi-bin/
+ </highlight>
</note>
</summary>
<p>For simple name-based virtual hosts you might use the
following directives in your server configuration file:</p>
- <example>
- UseCanonicalName Off<br />
- VirtualDocumentRoot /usr/local/apache/vhosts/%0
- </example>
+ <highlight language="config">
+UseCanonicalName Off
+VirtualDocumentRoot /usr/local/apache/vhosts/%0
+ </highlight>
<p>A request for
<code>http://www.example.com/directory/file.html</code> will be
<code>vhosts</code> directory. To do this you might use the
following in your configuration file:</p>
- <example>
- UseCanonicalName Off<br />
- VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2
- </example>
+ <highlight language="config">
+UseCanonicalName Off
+VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2
+ </highlight>
<p>A request for
<code>http://www.domain.example.com/directory/file.html</code>
<p>A more even spread of files can be achieved by hashing from the
end of the name, for example: </p>
-<example>
+<highlight language="config">
VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2
-</example>
+</highlight>
<p>The example request would come from
<code>/usr/local/apache/vhosts/example.com/n/i/a/domain/directory/file.html</code>.</p>
<p>Alternatively you might use: </p>
-<example>
+<highlight language="config">
VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+
-</example>
+</highlight>
<p>The example request would come from
<code>/usr/local/apache/vhosts/example.com/d/o/m/ain/directory/file.html</code>.</p>
<p>For IP-based virtual hosting you might use the following in
your configuration file:</p>
- <example>
- UseCanonicalName DNS<br />
- VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs<br />
- VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin
- </example>
+ <highlight language="config">
+UseCanonicalName DNS
+VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs
+VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin
+ </highlight>
<p>A request for
<code>http://www.domain.example.com/directory/file.html</code>
a <code>%</code> directive, you can work around the problem in
the following way:</p>
-<example>
+<highlight language="config">
VirtualDocumentRoot /usr/local/apache/vhosts/%2.0.%3.0
-</example>
+</highlight>
<p>A request for
<code>http://www.domain.example.com/directory/file.html</code>
information, you can set this default to help mod_xml2enc process
the data correctly. For example, to work with the default value
of Latin1 (<var>iso-8859-1</var> specified in HTTP/1.0, use</p>
- <example>xml2EncDefault iso-8859-1</example>
+ <highlight language="config">xml2EncDefault iso-8859-1</highlight>
</usage>
</directivesynopsis>
<directive module="core">ServerRoot</directive>.</p>
<example><title>Example</title>
+ <highlight language="config">
PidFile /var/run/apache.pid
+ </highlight>
</example>
<p>It is often useful to be able to send the server a signal,
<p>For example, to make the server accept connections on both
port 80 and port 8000, use:</p>
- <example>
- Listen 80<br />
- Listen 8000
- </example>
+ <highlight language="config">
+Listen 80
+Listen 8000
+ </highlight>
<p>To make the server accept connections on two specified
interfaces and port numbers, use </p>
- <example>
- Listen 192.170.2.1:80<br />
- Listen 192.170.2.5:8000
- </example>
+ <highlight language="config">
+Listen 192.170.2.1:80
+Listen 192.170.2.5:8000
+ </highlight>
<p>IPv6 addresses must be surrounded in square brackets, as in the
following example:</p>
- <example>
+ <highlight language="config">
Listen [2001:db8::a00:20ff:fea7:ccea]:80
- </example>
+ </highlight>
<p>The optional <var>protocol</var> argument is not required for most
configurations. If not specified, <code>https</code> is the default for
<p>You only need to set the protocol if you are running on non-standard
ports. For example, running an <code>https</code> site on port 8443:</p>
- <example>
+ <highlight language="config">
Listen 192.170.2.1:8443 https
- </example>
+ </highlight>
<note><title>Error condition</title>
Multiple <directive>Listen</directive> directives for the same ip
Apache httpd to always create the file on the disk.</p>
<example><title>Example</title>
+ <highlight language="config">
ScoreBoardFile /var/run/apache_status
+ </highlight>
</example>
<p>File-based shared memory is useful for third-party applications
<p>A typical configuration of the process-thread controls in
the <module>worker</module> MPM could look as follows:</p>
- <example>
- ServerLimit 16<br />
- StartServers 2<br />
- MaxRequestWorkers 150<br />
- MinSpareThreads 25<br />
- MaxSpareThreads 75<br />
- ThreadsPerChild 25
- </example>
+ <highlight language="config">
+ServerLimit 16
+StartServers 2
+MaxRequestWorkers 150
+MinSpareThreads 25
+MaxSpareThreads 75
+ThreadsPerChild 25
+ </highlight>
<p>While the parent process is usually started as <code>root</code>
under Unix in order to bind to port 80, the child processes and threads