fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<?xml version="1.0" encoding="ISO-8859-1"?>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head>
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
fd9abdda70912b99b24e3bf1a38f26fde908a74cnd<!--
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess This file is generated from xml source: DO NOT EDIT
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
5a58787efeb02a1c3f06569d019ad81fd2efa06end -->
96ad5d81ee4a2cc66a4ae19893efc8aa6d06fae7jailletc<title>Name-based Virtual Host Support - Apache HTTP Server Version 2.5</title>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="/style/css/prettify.css" />
2e545ce2450a9953665f701bb05350f0d3f26275nd<script src="/style/scripts/prettify.min.js" type="text/javascript">
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen</script>
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
5a58787efeb02a1c3f06569d019ad81fd2efa06end<link href="/images/favicon.ico" rel="shortcut icon" /></head>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<body id="manual-page"><div id="page-header">
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<p class="apache">Apache HTTP Server Version 2.5</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<img alt="" src="/images/feather.gif" /></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div id="path">
3f08db06526d6901aa08c110b5bc7dde6bc39905nd<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.5</a> &gt; <a href="./">Virtual Hosts</a></div><div id="page-content"><div id="preamble"><h1>Name-based Virtual Host Support</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess<p><span>Available Languages: </span><a href="/de/vhosts/name-based.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess<a href="/en/vhosts/name-based.html" title="English">&nbsp;en&nbsp;</a> |
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd<a href="/fr/vhosts/name-based.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/vhosts/name-based.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi<a href="/ko/vhosts/name-based.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/tr/vhosts/name-based.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd
2d65870e5794cea54f4001239169a891789b7890nd <p>This document describes when and how to use name-based virtual hosts.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div id="quickview"><ul id="toc"><li><img alt="" src="/images/down.gif" /> <a href="#namevip">Name-based vs. IP-based Virtual Hosts</a></li>
2b4e67038708a5b76abe74f381f0242421bc0012nd<li><img alt="" src="/images/down.gif" /> <a href="#alg">How the server selects the proper name-based virtual host</a></li>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<li><img alt="" src="/images/down.gif" /> <a href="#using">Using Name-based Virtual Hosts</a></li>
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh</ul><h3>See also</h3><ul class="seealso"><li><a href="ip-based.html">IP-based Virtual Host Support</a></li><li><a href="details.html">An In-Depth Discussion of Virtual Host Matching</a></li><li><a href="mass.html">Dynamically configured mass virtual hosting</a></li><li><a href="examples.html">Virtual Host examples for common setups</a></li></ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="section">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="namevip" id="namevip">Name-based vs. IP-based Virtual Hosts</a></h2>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
60a4b2c422dcbb08a554fb193105c08da592718bpoirier <p><a href="ip-based.html">IP-based virtual hosts</a> use the IP address of the connection to
2d65870e5794cea54f4001239169a891789b7890nd determine the correct virtual host to serve. Therefore you need to
60a4b2c422dcbb08a554fb193105c08da592718bpoirier have a separate IP address for each host.</p>
60a4b2c422dcbb08a554fb193105c08da592718bpoirier
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>With name-based virtual hosting, the server relies on the client to
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf report the hostname as part of the HTTP headers. Using this technique,
2b4e67038708a5b76abe74f381f0242421bc0012nd many different hosts can share the same IP address.</p>
2d65870e5794cea54f4001239169a891789b7890nd
2d65870e5794cea54f4001239169a891789b7890nd <p>Name-based virtual hosting is usually simpler, since you need
2d65870e5794cea54f4001239169a891789b7890nd only configure your DNS server to map each hostname to the correct
2d65870e5794cea54f4001239169a891789b7890nd IP address and then configure the Apache HTTP Server to recognize
a290fea4668ef3d7b7de3efbd5696c2c1ac2cbd9rbowen the different hostnames. Name-based virtual hosting also eases
a290fea4668ef3d7b7de3efbd5696c2c1ac2cbd9rbowen the demand for scarce IP addresses. Therefore you should use
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic name-based virtual hosting unless you are using equipment
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic that explicitly demands IP-based hosting. Historical reasons for
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic IP-based virtual hosting based on client support are no longer
8e9c6d6438af1ccb46adaa60d34caa3ac98f3851igalic applicable to a general-purpose web server.</p>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <p> Name-based virtual hosting builds off of the IP-based virtual host
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf selection algorithm, meaning that searches for the proper server name
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf occur only between virtual hosts that have the best IP-based address.</p>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf
2b4e67038708a5b76abe74f381f0242421bc0012nd</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
2b4e67038708a5b76abe74f381f0242421bc0012nd<div class="section">
2b4e67038708a5b76abe74f381f0242421bc0012nd<h2><a name="alg" id="alg">How the server selects the proper name-based virtual host</a></h2>
2b4e67038708a5b76abe74f381f0242421bc0012nd
2b4e67038708a5b76abe74f381f0242421bc0012nd <p>It is important to recognize that the first step in name-based virtual
2b4e67038708a5b76abe74f381f0242421bc0012nd host resolution is IP-based resolution. Name-based virtual host
2b4e67038708a5b76abe74f381f0242421bc0012nd resolution only chooses the most appropriate name-based virtual host
2b4e67038708a5b76abe74f381f0242421bc0012nd after narrowing down the candidates to the best IP-based match. Using a wildcard (*)
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf for the IP address in all of the VirtualHost directives makes this
2b4e67038708a5b76abe74f381f0242421bc0012nd IP-based mapping irrelevant.</p>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p>When a request arrives, the server will find the best (most specific) matching
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> argument based on
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf the IP address and port used by the request. If there is more than one virtual host
65a611af7093423efb91e5794b8887a527d4cf63trawick containing this best-match address and port combination, Apache will further
65a611af7093423efb91e5794b8887a527d4cf63trawick compare the <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> and <code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code> directives to the server name
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf present in the request.</p>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <p>If you omit the <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code>
205f749042ed530040a4f0080dbcb47ceae8a374rjung directive from any name-based virtual host, the server will default
205f749042ed530040a4f0080dbcb47ceae8a374rjung to a fully qualified domain name (FQDN) derived from the system hostname.
205f749042ed530040a4f0080dbcb47ceae8a374rjung This implicitly set server name can lead to counter-intuitive virtual host
205f749042ed530040a4f0080dbcb47ceae8a374rjung matching and is discouraged.</p>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <h3><a name="defaultvhost" id="defaultvhost">The default name-based vhost for an IP and port combination </a></h3>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p> If no matching ServerName or ServerAlias is found in the set of
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf virtual hosts containing the most specific matching IP address and port
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf combination, then <strong>the first listed virtual host</strong> that
4cb65c31bc681540ea623e1cb2bdd09749fb8d7esf matches that will be used.</p>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
5a58787efeb02a1c3f06569d019ad81fd2efa06end<div class="section">
5a58787efeb02a1c3f06569d019ad81fd2efa06end<h2><a name="using" id="using">Using Name-based Virtual Hosts</a></h2>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf<table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="/mod/core.html">core</a></code></li></ul></td><td><ul><li><code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code></li><li><code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code></li><li><code class="directive"><a href="/mod/core.html#servername">ServerName</a></code></li><li><code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code></li></ul></td></tr></table>
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <p>The first step is to create a <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> block for
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf each different host that you would like to serve. Inside each <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> block, you will need at minimum a
2d65870e5794cea54f4001239169a891789b7890nd <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> directive to designate
2d65870e5794cea54f4001239169a891789b7890nd which host is served and a <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code>
2d65870e5794cea54f4001239169a891789b7890nd directive to show where in the filesystem the content for that host
2d65870e5794cea54f4001239169a891789b7890nd lives.</p>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
d13b6921a1ab0e823f5a028da1d5f9c83bfc75c2rbowen <div class="note"><h3>Main host goes away</h3>
2b4e67038708a5b76abe74f381f0242421bc0012nd <p> Any request that doesn't match an existing <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> is handled by the global
2b4e67038708a5b76abe74f381f0242421bc0012nd server configuration, regardless of the hostname or ServerName.</p>
2b4e67038708a5b76abe74f381f0242421bc0012nd
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf <p> When you add a name-based virtual host to an existing server, and
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf the virtual host arguments match preexisting IP and port combinations,
2b4e67038708a5b76abe74f381f0242421bc0012nd requests will now be handled by an explicit virtual host. In this case,
2b4e67038708a5b76abe74f381f0242421bc0012nd it's usually wise to create a <a href="#defaultvhost">default virtual host</a>
9a58dc6a2b26ec128b1270cf48810e705f1a90dbsf with a <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> matching that of
2b4e67038708a5b76abe74f381f0242421bc0012nd the base server. New domains on the same interface and port, but
2b4e67038708a5b76abe74f381f0242421bc0012nd requiring separate configurations, can then be added as subsequent (non-default)
2b4e67038708a5b76abe74f381f0242421bc0012nd virtual hosts.</p>
d13b6921a1ab0e823f5a028da1d5f9c83bfc75c2rbowen </div>
fefb8b844b6286bfc41bb2e0c4cc003b8e7d4ff2kess
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener <div class="note"><h3>ServerName inheritance</h3>
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener <p> It is best to always explicitly list a <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> in every name-based virtual host.</p>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <p>If a <code class="directive"><a href="/mod/core.html#virtualhost">VirtualHost</a></code> doesn't specify
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar a <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code>, a server name will be
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar inherited from the base server configuration. If no server name was
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener specified globally, one is detected at startup through reverse DNS resolution
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener of the first listening address. In either case, this inherited server name
a68c8a0a86dbcc9aed56e0b38be1d00fabb42be4jailletc will influence name-based virtual host resolution, so it is best to always
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener explicitly list a <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> in every
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener name-based virtual host.</p>
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener </div>
1e3b6ba81cf78d630f1dd01e025d3084909e327fcovener
2d65870e5794cea54f4001239169a891789b7890nd <p>For example, suppose that you are serving the domain
2b4e67038708a5b76abe74f381f0242421bc0012nd <code>www.example.com</code> and you wish to add the virtual host
2b4e67038708a5b76abe74f381f0242421bc0012nd <code>other.example.com</code>, which points at the same IP address.
2d65870e5794cea54f4001239169a891789b7890nd Then you simply add the following to <code>httpd.conf</code>:</p>
2d65870e5794cea54f4001239169a891789b7890nd
4aa603e6448b99f9371397d439795c91a93637eand <pre class="prettyprint lang-config">&lt;VirtualHost *:80&gt;
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen # This first-listed virtual host is also the default for *:80
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen ServerName www.example.com
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar ServerAlias example.com
c3c937a1510d6ff9cfa28ef3713e787f0e1a39c9coar DocumentRoot "/www/domain"
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen&lt;/VirtualHost&gt;
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen&lt;VirtualHost *:80&gt;
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh ServerName other.example.com
c3c937a1510d6ff9cfa28ef3713e787f0e1a39c9coar DocumentRoot "/www/otherdomain"
4aa603e6448b99f9371397d439795c91a93637eand&lt;/VirtualHost&gt;</pre>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen
2d65870e5794cea54f4001239169a891789b7890nd
2d65870e5794cea54f4001239169a891789b7890nd <p>You can alternatively specify an explicit IP address in place of the
6e14faf37935e36804b8bad802bc9dd58f3cf65dsf <code>*</code> in <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> directives. For example, you might want to do this
2d65870e5794cea54f4001239169a891789b7890nd in order to run some name-based virtual hosts on one IP address, and either
2d65870e5794cea54f4001239169a891789b7890nd IP-based, or another set of name-based virtual hosts on another address.</p>
2d65870e5794cea54f4001239169a891789b7890nd
2d65870e5794cea54f4001239169a891789b7890nd <p>Many servers want to be accessible by more than one name. This is
2d65870e5794cea54f4001239169a891789b7890nd possible with the <code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code>
2d65870e5794cea54f4001239169a891789b7890nd directive, placed inside the <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> section. For example in the first <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> block above, the
2d65870e5794cea54f4001239169a891789b7890nd <code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code> directive indicates that
2d65870e5794cea54f4001239169a891789b7890nd the listed names are other names which people can use to see that same
2d65870e5794cea54f4001239169a891789b7890nd web site:</p>
2d65870e5794cea54f4001239169a891789b7890nd
20f499565e77defe9dab24dd85c02f38a1175855nd <pre class="prettyprint lang-config">ServerAlias example.com *.example.com</pre>
c3c006c28c5b03892ccaef6e4d2cbb15a13a2072rbowen
2d65870e5794cea54f4001239169a891789b7890nd
2b4e67038708a5b76abe74f381f0242421bc0012nd <p>then requests for all hosts in the <code>example.com</code> domain will
2b4e67038708a5b76abe74f381f0242421bc0012nd be served by the <code>www.example.com</code> virtual host. The wildcard
2d65870e5794cea54f4001239169a891789b7890nd characters <code>*</code> and <code>?</code> can be used to match names.
2d65870e5794cea54f4001239169a891789b7890nd Of course, you can't just make up names and place them in <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> or <code>ServerAlias</code>. You must
2d65870e5794cea54f4001239169a891789b7890nd first have your DNS server properly configured to map those names to an IP
2d65870e5794cea54f4001239169a891789b7890nd address associated with your server.</p>
2d65870e5794cea54f4001239169a891789b7890nd
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar <p>Name-based virtual hosts for the best-matching set of <code class="directive"><a href="/mod/core.html#virtualhost">&lt;virtualhost&gt;</a></code>s are processed
93ba02fbe3bb9ce8bb06af6b8ecdb88288e1c0c2covener in the order they appear in the configuration. The first matching <code class="directive"><a href="/mod/core.html#servername">ServerName</a></code> or <code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code> is used, with no different precedence for wildcards
93ba02fbe3bb9ce8bb06af6b8ecdb88288e1c0c2covener (nor for ServerName vs. ServerAlias). </p>
93ba02fbe3bb9ce8bb06af6b8ecdb88288e1c0c2covener
c9d6480dce82f1c386bba7a29baa867ecddf2daecovener <p>The complete list of names in the <code class="directive"><a href="/mod/core.html#virtualhost">VirtualHost</a></code>
5d01f40ffd657dd2ac567aacd93cabd162ddfa79coar directive are treated just like a (non wildcard)
c9d6480dce82f1c386bba7a29baa867ecddf2daecovener <code class="directive"><a href="/mod/core.html#serveralias">ServerAlias</a></code>.</p>
c9d6480dce82f1c386bba7a29baa867ecddf2daecovener
2d65870e5794cea54f4001239169a891789b7890nd <p>Finally, you can fine-tune the configuration of the virtual hosts
2d65870e5794cea54f4001239169a891789b7890nd by placing other directives inside the <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> containers. Most directives can be
2d65870e5794cea54f4001239169a891789b7890nd placed in these containers and will then change the configuration only of
2d65870e5794cea54f4001239169a891789b7890nd the relevant virtual host. To find out if a particular directive is allowed,
2d65870e5794cea54f4001239169a891789b7890nd check the <a href="/mod/directive-dict.html#Context">Context</a> of the
2d65870e5794cea54f4001239169a891789b7890nd directive. Configuration directives set in the <em>main server context</em>
2d65870e5794cea54f4001239169a891789b7890nd (outside any <code class="directive"><a href="/mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
2d65870e5794cea54f4001239169a891789b7890nd container) will be used only if they are not overridden by the virtual host
2d65870e5794cea54f4001239169a891789b7890nd settings.</p>
2d65870e5794cea54f4001239169a891789b7890nd
5a58787efeb02a1c3f06569d019ad81fd2efa06end</div></div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="bottomlang">
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess<p><span>Available Languages: </span><a href="/de/vhosts/name-based.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
4be0f2d2988dc74815a5f9f4a308fbef2c29674ekess<a href="/en/vhosts/name-based.html" title="English">&nbsp;en&nbsp;</a> |
d05d0eb4ae6d2a5e513fc3bf2555ce33da416634nd<a href="/fr/vhosts/name-based.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
7f5b59ccc63c0c0e3e678a168f09ee6a2f51f9d0nd<a href="/ja/vhosts/name-based.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
ecc5150d35c0dc5ee5119c2717e6660fa331abbftakashi<a href="/ko/vhosts/name-based.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung<a href="/tr/vhosts/name-based.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
727872d18412fc021f03969b8641810d8896820bhumbedooh</div><div class="top"><a href="#page-header"><img src="/images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
0d0ba3a410038e179b695446bb149cce6264e0abnd<script type="text/javascript"><!--//--><![CDATA[//><!--
727872d18412fc021f03969b8641810d8896820bhumbedoohvar comments_shortname = 'httpd';
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedoohvar comments_identifier = 'http://httpd.apache.org/docs/trunk/vhosts/name-based.html';
0d0ba3a410038e179b695446bb149cce6264e0abnd(function(w, d) {
cc7e1025de9ac63bd4db6fe7f71c158b2cf09fe4humbedooh if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread"><\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd var s = d.createElement('script');
0d0ba3a410038e179b695446bb149cce6264e0abnd s.type = 'text/javascript';
0d0ba3a410038e179b695446bb149cce6264e0abnd s.async = true;
ac082aefa89416cbdc9a1836eaf3bed9698201c8humbedooh s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
0d0ba3a410038e179b695446bb149cce6264e0abnd (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
0d0ba3a410038e179b695446bb149cce6264e0abnd }
0d0ba3a410038e179b695446bb149cce6264e0abnd else {
727872d18412fc021f03969b8641810d8896820bhumbedooh d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
0d0ba3a410038e179b695446bb149cce6264e0abnd }
0d0ba3a410038e179b695446bb149cce6264e0abnd})(window, document);
30471a4650391f57975f60bbb6e4a90be7b284bfhumbedooh//--><!]]></script></div><div id="footer">
205f749042ed530040a4f0080dbcb47ceae8a374rjung<p class="apache">Copyright 2015 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
af33a4994ae2ff15bc67d19ff1a7feb906745bf8rbowen<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/quickreference.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!--
0d0ba3a410038e179b695446bb149cce6264e0abndif (typeof(prettyPrint) !== 'undefined') {
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd prettyPrint();
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd}
7fec19672a491661b2fe4b29f685bc7f4efa64d4nd//--><!]]></script>
5a58787efeb02a1c3f06569d019ad81fd2efa06end</body></html>