24.5 Virtual Hosts
A separate web server for each website (for each host) would be a waste of resources given the performance of current computers! Thanks to virtual hosts, a web server can operate many websites in parallel.
From a technical perspective, there are three methods for Apache to decide which virtual host a web request is directed to. In any case, the HTTP header transmitted from the browser to the server serves as the starting point:
-
Name-based virtual hostsApache recognizes the desired website by the host name contained in the HTTP header. This variant is the easiest to implement and the most widespread.
-
IP-based virtual hostsApache recognizes the required website by the IP address in the header. This approach is associated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access