Apache + Perl + PHP3 + MySQL Windows 9x


MySQL - 6


and one virtual host should catch any request to hostnames of the form *.sub.domain.tld with www.sub.domain.tld as its server name. The address 111.22.33.55

should be used for the virtual hosts.

Server configuration:

...

Port 80

ServerName www.domain.tld

DocumentRoot /www/domain

 

NameVirtualHost 111.22.33.55

 

<VirtualHost 111.22.33.55>

DocumentRoot /www/otherdomain

ServerName www.otherdomain.tld

...

</VirtualHost>

<VirtualHost 111.22.33.55>

DocumentRoot /www/subdomain

ServerName www.sub.domain.tld

ServerAlias *.sub.domain.tld

...

</VirtualHost>

Any request to an address other than 111.22.33.55 will be served from the main server. A request to 111.22.33.55

with an unknown or no Host: header will be served from www.otherdomain.tld.

Mixed name-/IP-based vhosts

         Setup: The server machine has three IP addresses (111.22.33.44, 111.22.33.55 and 111.22.33.66) which resolve to the names server.domain.tld, www.otherdomain1.tld and www.otherdomain2.tld respectively. The address 111.22.33.44

should we used for a couple of name-based vhosts and the other addresses for IP-based vhosts.

Server configuration:

...

Port 80

ServerName server.domain.tld

 

NameVirtualHost 111.22.33.44

 

<VirtualHost 111.22.33.44>

DocumentRoot /www/domain

ServerName www.domain.tld

...

</VirtualHost>

<VirtualHost 111.22.33.44>

DocumentRoot /www/subdomain1

ServerName www.sub1.domain.tld

...

</VirtualHost>

<VirtualHost 111.22.33.44>

DocumentRoot /www/subdomain2

ServerName www.sub2.domain.tld

...

</VirtualHost>

<VirtualHost 111.22.33.55>

DocumentRoot /www/otherdomain1

ServerName www.otherdomain1.tld

...

</VirtualHost>

<VirtualHost 111.22.33.66>




- -  - -  - -