Apache + Perl + PHP3 + MySQL Windows 9x


MySQL - 5


...

Port 80

Listen 111.22.33.44:80

Listen 111.22.33.55:8080

ServerName server.domain.tld

<VirtualHost 111.22.33.44:80>

DocumentRoot /www/domain

ServerName www.domain.tld

...

</VirtualHost>

 

<VirtualHost 111.22.33.55:8080>

ServerName www-cache.domain.tld

...

<Directory proxy:>

order deny,allow

deny from all

allow from 111.22.33

</Directory>

</VirtualHost>

The main server can never catch a request, because all IP addresses (apart from localhost) of our machine are in use for IP-based virtual hosts. The web server can only be reached on the first address through port 80 and the proxy only on the second address through port 8080.

Name-based vhosts only

         Setup 1: The server machine has one IP address (111.22.33.44) which resolves to the name server.domain.tld. There are two aliases (CNAMEs) www.domain.tld

and www.sub.domain.tld

for the address 111.22.33.44.

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/subdomain

ServerName www.sub.domain.tld

...

</VirtualHost>

Apart from localhost

there are no unspecified addresses/ports, therefore the main server only serves localhost requests. Due to the fact that www.domain.tld has the highest priority it can be seen as the default or primary server.

         Setup 2: The server machine has two IP addresses (111.22.33.44

and 111.22.33.55) which resolve to the names server1.domain.tld

and server2.domain.tld

respectively. The alias www.domain.tld

should be used for the main server which should also catch any unspecified addresses. We want to use a virtual host for the alias www.otherdomain.tld




- -  - -  - -