Virtual host
lastmod 2018-08-17created 2017-01-021 edits
A web server has a host that exists by default. This is called the web server's main host.
Besides the main host, a single web server can be configured to run multiple hosts, each with its own home directory. This is mainly used for web hosting services, and all hosts other than the main host are called virtual hosts. Web hosting services are the most fitting use of such virtual hosts. To provide a web hosting service, a single server must accommodate multiple subscribers, and this can be solved by configuring and running them as virtual hosts of the Apache web server. Of course, other web servers have this feature too, and the configuration method differs slightly.
- Name-based virtual host.
- Address-based virtual host (~IP-based virtual host).
- Port-based virtual host.
- Default virtual host.
All four cases above assume operation on a single physical server and running multiple virtual hosts. A name-based virtual host runs multiple virtual hosts on one IP Address; an address-based virtual host assigns one IP Address to each virtual host; and a port-based virtual host runs on one and the same host with only different ports specified. Finally, the default virtual host specifies the host that responds by default when a load request arrives for a host that matches none of the configured hosts.
See also
- Apache:Httpd:VirtualHost: How to configure Apache HTTPD virtual hosts.