<h2><a name="example" id="example">A Simple Example</a></h2>
- <div class="example"><p><code>
- # This is a misconfiguration example, do not use on your server <br />
- <VirtualHost www.example.dom> <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </code></p></div>
+ <pre class="prettyprint lang-config">
+# This is a misconfiguration example, do not use on your server
+<VirtualHost www.example.dom>
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </pre>
+
<p>In order for the server to function properly, it absolutely needs
to have two pieces of information about each virtual host: the
<p>Suppose that <code>www.example.dom</code> has address 192.0.2.1.
Then consider this configuration snippet:</p>
- <div class="example"><p><code>
- # This is a misconfiguration example, do not use on your server <br />
- <VirtualHost 192.0.2.1> <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </code></p></div>
+ <pre class="prettyprint lang-config">
+# This is a misconfiguration example, do not use on your server
+<VirtualHost 192.0.2.1>
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </pre>
+
<p>This time httpd needs to use reverse DNS to find the
<code>ServerName</code> for this virtualhost. If that reverse
<p>Here is a snippet that avoids both of these problems:</p>
- <div class="example"><p><code>
- <VirtualHost 192.0.2.1> <br />
- ServerName www.example.dom <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </code></p></div>
+ <pre class="prettyprint lang-config">
+<VirtualHost 192.0.2.1>
+ ServerName www.example.dom
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </pre>
+
</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
<div class="section">
<h2><a name="denial" id="denial">Denial of Service</a></h2>
<p>Consider this configuration snippet:</p>
- <div class="example"><p><code>
- <VirtualHost www.example1.dom><br />
- <span class="indent">
- ServerAdmin webgirl@example1.dom<br />
- DocumentRoot /www/example1<br />
- </span>
- </VirtualHost><br />
- <br />
- <VirtualHost www.example2.dom><br />
- <span class="indent">
- ServerAdmin webguy@example2.dom<br />
- DocumentRoot /www/example2<br />
- </span>
- </VirtualHost>
- </code></p></div>
+ <pre class="prettyprint lang-config">
+<VirtualHost www.example1.dom>
+ ServerAdmin webgirl@example1.dom
+ DocumentRoot /www/example1
+</VirtualHost>
+<VirtualHost www.example2.dom>
+ ServerAdmin webguy@example2.dom
+ DocumentRoot /www/example2
+</VirtualHost>
+ </pre>
+
<p>Suppose that you've assigned 192.0.2.1 to
<code>www.example1.dom</code> and 192.0.2.2 to
<section id="example">
<title>A Simple Example</title>
- <example>
- # This is a misconfiguration example, do not use on your server <br />
- <VirtualHost www.example.dom> <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </example>
+ <highlight language="config">
+# This is a misconfiguration example, do not use on your server
+<VirtualHost www.example.dom>
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </highlight>
<p>In order for the server to function properly, it absolutely needs
to have two pieces of information about each virtual host: the
<p>Suppose that <code>www.example.dom</code> has address 192.0.2.1.
Then consider this configuration snippet:</p>
- <example>
- # This is a misconfiguration example, do not use on your server <br />
- <VirtualHost 192.0.2.1> <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </example>
+ <highlight language="config">
+# This is a misconfiguration example, do not use on your server
+<VirtualHost 192.0.2.1>
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </highlight>
<p>This time httpd needs to use reverse DNS to find the
<code>ServerName</code> for this virtualhost. If that reverse
<p>Here is a snippet that avoids both of these problems:</p>
- <example>
- <VirtualHost 192.0.2.1> <br />
- ServerName www.example.dom <br />
- ServerAdmin webgirl@example.dom <br />
- DocumentRoot /www/example <br />
- </VirtualHost>
- </example>
+ <highlight language="config">
+<VirtualHost 192.0.2.1>
+ ServerName www.example.dom
+ ServerAdmin webgirl@example.dom
+ DocumentRoot /www/example
+</VirtualHost>
+ </highlight>
</section>
<section id="denial">
<p>Consider this configuration snippet:</p>
- <example>
- <VirtualHost www.example1.dom><br />
- <indent>
- ServerAdmin webgirl@example1.dom<br />
- DocumentRoot /www/example1<br />
- </indent>
- </VirtualHost><br />
- <br />
- <VirtualHost www.example2.dom><br />
- <indent>
- ServerAdmin webguy@example2.dom<br />
- DocumentRoot /www/example2<br />
- </indent>
- </VirtualHost>
- </example>
+ <highlight language="config">
+<VirtualHost www.example1.dom>
+ ServerAdmin webgirl@example1.dom
+ DocumentRoot /www/example1
+</VirtualHost>
+<VirtualHost www.example2.dom>
+ ServerAdmin webguy@example2.dom
+ DocumentRoot /www/example2
+</VirtualHost>
+ </highlight>
<p>Suppose that you've assigned 192.0.2.1 to
<code>www.example1.dom</code> and 192.0.2.2 to