For a while, I've been hosting virtual hosts that are available on both
an internal (intranet) interface as well as an external (internet)
interface. And based on the documentation, I thought that I had to have
separate VirtualHost directives for each of those interfaces. I
discovered quite by accident that I can put both of those IP addresses
in the same VirtualHost directive. I'm sure that this is documented more
clearly somewhere else, but it's not in the place that I am most likely
to look. In core.html, it says:
Syntax: <VirtualHost addr[:port] ...> ... </VirtualHost>
but I never really thought about what that ... was supposed to mean. I
suppose I should have figured it out, but somehow I never did. It's
pretty obvious when you know what it means.
So, without further ado:
[rbowen@buglet mod]$ cvs diff -u core.html
Index: core.html
===================================================================
RCS file: /home/cvspublic/httpd-docs-1.3/htdocs/manual/mod/core.html,v
retrieving revision 1.166
diff -u -r1.166 core.html
--- core.html 2000/02/28 13:42:23 1.166
+++ core.html 2000/08/29 02:01:00
@@ -3330,6 +3330,21 @@
command (if your OS supports it), or with kernel patches like <A
HREF="../misc/vif-info.html">VIF</A> (for SunOS(TM) 4.1.x)).<P>
+You can specify more than one IP address. This is useful if a machine
+responds to the same name on two different interfaces. For example,
+if you have a VirtualHost that is available to hosts on an internal
+(intranet) as well as external (internet) network.
+
+Example:
+<BLOCKQUOTE>
+<CODE>
+<VirtualHost 192.168.1.2 204.255.176.199><BR>
+DocumentRoot /www/docs/host.foo.com<BR>
+ServerName host.foo.com<BR>
+ServerAlias host<BR>
+</VirtualHost>
+</CODE></BLOCKQUOTE>
+
The special name <CODE>_default_</CODE> can be specified in which case
this virtual host will match any IP address that is not explicitly
listed
in another virtual host. In the absence of any _default_ virtual host
--
rbowen@rcbowen.com
Come hear me at ApacheCon! - http://www.apachecon.com/
Author - Apache Server Unleashed - http://apacheunleashed.com/
an internal (intranet) interface as well as an external (internet)
interface. And based on the documentation, I thought that I had to have
separate VirtualHost directives for each of those interfaces. I
discovered quite by accident that I can put both of those IP addresses
in the same VirtualHost directive. I'm sure that this is documented more
clearly somewhere else, but it's not in the place that I am most likely
to look. In core.html, it says:
Syntax: <VirtualHost addr[:port] ...> ... </VirtualHost>
but I never really thought about what that ... was supposed to mean. I
suppose I should have figured it out, but somehow I never did. It's
pretty obvious when you know what it means.
So, without further ado:
[rbowen@buglet mod]$ cvs diff -u core.html
Index: core.html
===================================================================
RCS file: /home/cvspublic/httpd-docs-1.3/htdocs/manual/mod/core.html,v
retrieving revision 1.166
diff -u -r1.166 core.html
--- core.html 2000/02/28 13:42:23 1.166
+++ core.html 2000/08/29 02:01:00
@@ -3330,6 +3330,21 @@
command (if your OS supports it), or with kernel patches like <A
HREF="../misc/vif-info.html">VIF</A> (for SunOS(TM) 4.1.x)).<P>
+You can specify more than one IP address. This is useful if a machine
+responds to the same name on two different interfaces. For example,
+if you have a VirtualHost that is available to hosts on an internal
+(intranet) as well as external (internet) network.
+
+Example:
+<BLOCKQUOTE>
+<CODE>
+<VirtualHost 192.168.1.2 204.255.176.199><BR>
+DocumentRoot /www/docs/host.foo.com<BR>
+ServerName host.foo.com<BR>
+ServerAlias host<BR>
+</VirtualHost>
+</CODE></BLOCKQUOTE>
+
The special name <CODE>_default_</CODE> can be specified in which case
this virtual host will match any IP address that is not explicitly
listed
in another virtual host. In the absence of any _default_ virtual host
--
rbowen@rcbowen.com
Come hear me at ApacheCon! - http://www.apachecon.com/
Author - Apache Server Unleashed - http://apacheunleashed.com/