Apache Virtual Host documentation - Apache HTTP Server Version 2.4

Apache Server 2.4

Apache HTTP Server Version 2.4

<-

Apache Virtual Host documentation

The term Virtual Host refers to the practice of running more than one web site (such as company1.example.com and company2.example.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.

Apache was one of the first servers to support IP-based virtual hosts right out of the box. Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts.

Below is a list of documentation pages which explain all details of virtual host support in Apache HTTP Server:

top
top

Configuration directives

If you are trying to debug your virtual host configuration, you may find the -S command line switch useful.

Unix example

apachectl -S

Windows example

httpd.exe -S

This command will dump out a description of how Apache parsed the configuration file. Careful examination of the IP addresses and server names may help uncover configuration mistakes. (See the docs for the httpd program for other command line options)