Return-Path:
To use name-based virtual hosting, you must designate the IP
@@ -89,7 +89,9 @@
The next step is to create a <VirtualHost> block for
@@ -104,26 +106,27 @@
show where in the filesystem the content for that host lives. For example, suppose that both www.domain.tld and
-www.otherdomain.tld point at the IP address
-111.22.33.44. Then you simply add the following
+www.otherdomain.tld point at an IP address
+that the server is listening to. Then you simply add the following
to In the simplest case, the IP address You can alternatively specify an explicit IP address in place of
+the * in both the Many servers want to be accessible by more than one name. This is
possible with the ServerName
or
Related Directives
-DocumentRoot
-NameVirtualHost
-ServerAlias
-ServerName
-ServerPath
-VirtualHost
+DocumentRoot
+NameVirtualHost
+ServerAlias
+ServerName
+ServerPath
+VirtualHost
NameVirtualHost
. Note that mentioning an IP address in a
NameVirtualHost
directive does not automatically make the
server listen to that IP address. See Setting
-which addresses and ports Apache uses for more details.
+which addresses and ports Apache uses for more details. In addition,
+any IP address specified here must be associated with a network interface
+on the server.httpd.conf
:
- NameVirtualHost 111.22.33.44
+ NameVirtualHost *
- <VirtualHost 111.22.33.44>
+ <VirtualHost *>
ServerName www.domain.tld
DocumentRoot /www/domain
</VirtualHost>
- <VirtualHost 111.22.33.44>
+ <VirtualHost *>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>
-111.22.44.33
can be
-replaced by *
to match all IP addresses for your server.NameVirtualHost
and
+<VirtualHost>
directives.ServerAlias
. You must first have your DNS server
-properly configured to map those names to the IP address in the
-NameVirtualHost
directive.
Finally, you can fine-tune the configuration of the virtual hosts by placing other directives inside the --------------------------------------------------------------------- To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org For additional commands, e-mail: docs-help@httpd.apache.org