03/03/10
Name-based virtual hosts
- Several hostnames share the same IP address
NameVirtualHost 143.239.75.211
ServerName www.cs.ucc.ie
ServerAlias we_are_great.ucc.ie
DocumentRoot /...../cs/
...
ServerName www.bis.ucc.ie
ServerAlias we_are_shite.ucc.ie
DocumentRoot /..../bis/
...
Suppose a client request arrives on 143.239.75.211
Every HTTP/1.1 request has a Host: header
Whichever ServerName matches the Host: header is
the Web site that Apache will use
If no match or no Host:, the default is the first
When IP-based, when name-based?