From 335e749ec99b30bd65eed2587d6759abd413d4b9 Mon Sep 17 00:00:00 2001
From: Joshua Slive To use name-based virtual hosting, you must designate the IP
@@ -89,7 +89,9 @@ be used, you can use The next step is to create a <VirtualHost> block for
@@ -104,26 +106,27 @@ href="../mod/core.html#documentroot">DocumentRoot directive to
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 www.domain.tld virtual host. The
wildcard characters * and ? can be used to match names. Of course,
you can't just make up names and place them in
Related Directives
-DocumentRoot
-NameVirtualHost
-ServerAlias
-ServerName
-ServerPath
-VirtualHost
+DocumentRoot
+NameVirtualHost
+ServerAlias
+ServerName
+ServerPath
+VirtualHost
*
as the argument to
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.ServerName
or 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 diff --git a/docs/manual/vhosts/name-based.html.en b/docs/manual/vhosts/name-based.html.en index b6bde6cef0..075140a6bf 100644 --- a/docs/manual/vhosts/name-based.html.en +++ b/docs/manual/vhosts/name-based.html.en @@ -72,12 +72,12 @@ they are on separate IP addresses.
To use name-based virtual hosting, you must designate the IP
@@ -89,7 +89,9 @@ be used, you can use *
as the argument to
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.
The next step is to create a <VirtualHost> block for @@ -104,26 +106,27 @@ href="../mod/core.html#documentroot">DocumentRoot directive to 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 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>-
In the simplest case, the IP address 111.22.44.33
can be
-replaced by *
to match all IP addresses for your server.
You can alternatively specify an explicit IP address in place of
+the * in both the NameVirtualHost
and
+<VirtualHost>
directives.
Many servers want to be accessible by more than one name. This is
possible with the www.domain.tld virtual host. The
wildcard characters * and ? can be used to match names. Of course,
you can't just make up names and place them in ServerName
or 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 -- 2.50.1