Commit fd419023 authored by dgaudet's avatar dgaudet
Browse files

Add documentation about :port in virtualhost. Note the necessity of

using _default_:* if the user wants to match all ips on all ports.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@78098 13f79535-47bb-0310-9956-ffa450edef68
parent 53043447
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -139,8 +139,11 @@ for your OS.
the IP address of any of the webservers will be served from the "main" or
"default" server configurations.  The "main" server configuration consists
of all those definitions appearing outside of any VirtualHost section.
You may want instead to define a <code>&lt;VirtualHost _default&gt;</code>
which returns 403 or 404 for all hits.
You may want instead to define a <code>&lt;VirtualHost _default_:*&gt;</code>
which returns 403 or 404 for all hits.  (The trailing <code>:*</code>
makes it apply to all ports, which is just a safety measure should you
begin using multiple <code><a href="mod/core.html#listen">Listen</a></code>
directives.)

<h3><a name="tips">Tips to Avoid these problems</a></h3>

@@ -149,7 +152,7 @@ which returns 403 or 404 for all hits.
<li> use IP addresses in <code>Listen</code>
<li> use IP addresses in <code>BindAddress</code>
<li> ensure all virtual hosts have an explicit <code>ServerName</code>
<li> create a <code>&lt;VirtualHost _default_&gt;</code> server that
<li> create a <code>&lt;VirtualHost _default_:*&gt;</code> server that
    has no pages to serve
</ul>

+7 −1
Original line number Diff line number Diff line
@@ -1370,7 +1370,7 @@ section. <em>Addr</em> can be
</menu> Example:
<blockquote>
<code>
&lt;VirtualHost host.foo.com&gt; <br>
&lt;VirtualHost 10.1.2.3&gt; <br>
ServerAdmin webmaster@host.foo.com <br>
DocumentRoot /www/docs/host.foo.com <br>
ServerName host.foo.com <br>
@@ -1393,6 +1393,12 @@ in another virtual host. In the absence of any _default_ virtual host
the "main" server config, consisting of all those definitions outside
any VirtualHost section, is used when no match occurs.<p>

You can specify a <code>:port</code> to change the port that is matched.
If unspecified then it defaults to the same port as the most recent
<code><a href="#port">Port</a></code> statement of the main server.  You
may also specify <code>:*</code> to match all ports on that address.
(This is recommended when used with <code>_default_</code>.)<p>

<strong>SECURITY</strong>: See the
<A HREF="../misc/security_tips.html">security tips</A> 
document for details on why your security could be compromised if