Name-based virtual hosts in Apache 2.0
Several HTTP sites can share one IP address when Apache selects the website using the request’s Host header. Both DNS and the server configuration must be correct; adding a virtual host does not create a DNS record.
Match the address and port
For sites sharing port 80 on the server’s available addresses, Apache 2.0 uses NameVirtualHost *:80 with corresponding <VirtualHost *:80> blocks. Give each block a ServerName, any intended ServerAlias names and its own DocumentRoot. Check the active Listen directives as well: a virtual-host block does not by itself make Apache listen on another port.
Choose the first host deliberately
The first virtual host for an address and port acts as the default for an unrecognised hostname. Put a deliberately chosen default site there rather than whichever customer happened to be configured first. Keep separate logs while commissioning and test each alias. An address-only browser request is not a sufficient test of a name-based site.
Check the request before changing DNS again
Use a temporary hosts-file entry or a client that can send the intended Host header directly to the server address. Run the configuration syntax check and inspect the reported virtual-host mapping before reloading. For SSL sites in the usual Apache 2.0 and browser configuration, plan separate IP addresses for sites needing different certificates; the certificate is selected before the HTTP Host header arrives.
Test an unknown hostname as well as the expected ones, and make sure it reaches the intended default. Remove workstation overrides before checking public DNS.