From: André Malo NameVirtualHost
directive.
In the normal case where any and all IP addresses on the server should
- 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
+ be used, you can use *
as the argument to NameVirtualHost
. If you're planning to use
+ multiple ports (e.g. running SSL) you should add a Port to the argument,
+ such as *:80
. 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. In addition, any IP address specified here must be
associated with a network interface on the server.
httpd.conf
:
- NameVirtualHost *
+ NameVirtualHost *:80
- <VirtualHost *>
+ <VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
@@ -119,7 +121,7 @@
</VirtualHost>
- <VirtualHost *>
+ <VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
diff --git a/docs/manual/vhosts/name-based.xml b/docs/manual/vhosts/name-based.xml
index 08c651a25d..8b416c7b36 100644
--- a/docs/manual/vhosts/name-based.xml
+++ b/docs/manual/vhosts/name-based.xml
@@ -76,10 +76,12 @@
module="core">NameVirtualHost directive.
In the normal case where any and all IP addresses on the server should
be used, you can use *
as the argument to *:80
. Note that mentioning an IP address in a
+
httpd.conf
: