Apache Virtual Host documentation - Apache HTTP Server Version 2.2 (original) (raw)
Please note
This document refers to the 2.2 version of Apache httpd, which is no longer maintained. The active release is documented here. If you have not already upgraded, please follow this link for more information.
You may follow this link to go to the current version of this document.
The term Virtual Host refers to the practice of running more than one web site (such ascompany1.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:
See also
[mod_vhost_alias](../mod/mod%5Fvhost%5Falias.html)
- Name-based virtual hosts
- IP-based virtual hosts
- Virtual host examples
- File descriptor limits
- Mass virtual hosting
- Details of host matching
Virtual Host Support
- Name-based Virtual Hosts (More than one web site per IP address)
- IP-based Virtual Hosts (An IP address for each web site)
- Virtual Host examples for common setups
- File Descriptor Limits (or,Too many log files)
- Dynamically Configured Mass Virtual Hosting
- In-Depth Discussion of Virtual Host Matching
Configuration directives
[NameVirtualHost](../mod/core.html#namevirtualhost)
[<VirtualHost>](../mod/core.html#virtualhost)
[ServerName](../mod/core.html#servername)
[ServerAlias](../mod/core.html#serveralias)
[ServerPath](../mod/core.html#serverpath)
If you are trying to debug your virtual host configuration, you may find the Apache -S
command line switch useful. That is, type the following command:
/usr/local/apache2/bin/httpd -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](../programs/httpd.html)
program for other command line options)