mod_vhost_alias.html.en revision c6a2d6fa44f8698851dec5051ee3782c2913605f
97a9a944b5887e91042b019776c41d5dd74557aferikabele<?xml version="1.0" encoding="ISO-8859-1"?>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
97a9a944b5887e91042b019776c41d5dd74557aferikabele<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki This file is generated from xml source: DO NOT EDIT
b1ced323143ade589985456a78f3f64d6a6580c5yoshiki XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd -->
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<title>mod_vhost_alias - Apache HTTP Server</title>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<body>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="page-header">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p class="apache">Apache HTTP Server Version 2.1</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<img alt="" src="/images/feather.gif" /></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="path">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<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-project/">Documentation</a> &gt; <a href="../">Version 2.1</a> &gt; <a href="./">Modules</a></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="page-content">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div id="preamble"><h1>Apache Module mod_vhost_alias</h1>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="toplang">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p><span>Available Languages: </span><a href="/en/mod/mod_vhost_alias.html" title="English">&nbsp;en&nbsp;</a></p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Provides for dynamically configured mass virtual
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4ndhosting</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>vhost_alias_module</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_vhost_alias.c</td></tr></table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<h3>Summary</h3>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>This module creates dynamically configured virtual hosts, by
06ba4a61654b3763ad65f52283832ebf058fdf1cslive allowing the IP address and/or the <code>Host:</code> header of
97a9a944b5887e91042b019776c41d5dd74557aferikabele the HTTP request to be used as part of the pathname to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive determine what files to serve. This allows for easy use of a
97a9a944b5887e91042b019776c41d5dd74557aferikabele huge number of virtual hosts with similar configurations.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <div class="note"><h3>Note</h3>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If <code class="module"><a href="/mod/mod_alias.html">mod_alias</a></code> or <code class="module"><a href="/mod/mod_userdir.html">mod_userdir</a></code> are
06ba4a61654b3763ad65f52283832ebf058fdf1cslive used for translating URIs to filenames, they will override the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directives of <code class="module"><a href="/mod/mod_vhost_alias.html">mod_vhost_alias</a></code> described below. For
97a9a944b5887e91042b019776c41d5dd74557aferikabele example, the following configuration will map <code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive /cgi-bin/script.pl</code> to <code>
97a9a944b5887e91042b019776c41d5dd74557aferikabele /usr/local/apache2/cgi-bin/script.pl</code> in all cases:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele <div class="example"><p><code>
97a9a944b5887e91042b019776c41d5dd74557aferikabele ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualScriptAlias /never/found/%0/cgi-bin/
97a9a944b5887e91042b019776c41d5dd74557aferikabele </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div id="quickview"><h3 class="directives">Directives</h3>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<ul id="toc">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#virtualdocumentroot">VirtualDocumentRoot</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#virtualdocumentrootip">VirtualDocumentRootIP</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#virtualscriptalias">VirtualScriptAlias</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#virtualscriptaliasip">VirtualScriptAliasIP</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</ul>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<h3>Topics</h3>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<ul id="topics">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#interpol">Directory Name Interpolation</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><img alt="" src="/images/down.gif" /> <a href="#examples">Examples</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</ul><h3>See also</h3>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<ul class="seealso">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><code class="directive"><a href="/mod/core.html#usecanonicalname">UseCanonicalName</a></code></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<li><a href="/vhosts/mass.html">Dynamically configured mass
06ba4a61654b3763ad65f52283832ebf058fdf1cslive virtual hosting</a></li>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</ul></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="section">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<h2><a name="interpol" id="interpol">Directory Name Interpolation</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>All the directives in this module interpolate a string into
06ba4a61654b3763ad65f52283832ebf058fdf1cslive a pathname. The interpolated string (henceforth called the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive "name") may be either the server name (see the <code class="directive"><a href="/mod/core.html#usecanonicalname">UseCanonicalName</a></code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directive for details on how this is determined) or the IP
06ba4a61654b3763ad65f52283832ebf058fdf1cslive address of the virtual host on the server in dotted-quad
06ba4a61654b3763ad65f52283832ebf058fdf1cslive format. The interpolation is controlled by specifiers inspired
06ba4a61654b3763ad65f52283832ebf058fdf1cslive by <code>printf</code> which have a number of formats:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele<table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele<tr><td><code>%%</code></td>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<td>insert a <code>%</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
97a9a944b5887e91042b019776c41d5dd74557aferikabele<tr><td><code>%p</code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<td>insert the port number of the virtual host</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><td><code>%N.M</code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<td>insert (part of) the name</td></tr>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd</table>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <p><code>N</code> and <code>M</code> are used to specify
117c1f888a14e73cdd821dc6c23eb0411144a41cnd substrings of the name. <code>N</code> selects from the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd dot-separated components of the name, and <code>M</code>
117c1f888a14e73cdd821dc6c23eb0411144a41cnd selects characters within whatever <code>N</code> has selected.
117c1f888a14e73cdd821dc6c23eb0411144a41cnd <code>M</code> is optional and defaults to zero if it isn't
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd present; the dot must be present if and only if <code>M</code>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd is present. The interpretation is as follows:</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <table>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <tr><td><code>0</code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <td>the whole name</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <tr><td><code>1</code></td>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd <td>the first part</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>2</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the second part</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>-1</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the last part</td></tr>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>-2</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the penultimate part</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>2+</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the second and all subsequent parts</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>-2+</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the penultimate and all preceding parts</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <tr><td><code>1+</code> and <code>-1+</code></td>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <td>the same as <code>0</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If <code>N</code> or <code>M</code> is greater than the number
06ba4a61654b3763ad65f52283832ebf058fdf1cslive of parts available a single underscore is interpolated. </p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div><div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="section">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<h2><a name="examples" id="examples">Examples</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>For simple name-based virtual hosts you might use the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive following directives in your server configuration file:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive UseCanonicalName Off<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRoot /usr/local/apache/vhosts/%0
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A request for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>http://www.example.com/directory/file.html</code> will be
06ba4a61654b3763ad65f52283832ebf058fdf1cslive satisfied by the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/www.example.com/directory/file.html</code>.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>For a very large number of virtual hosts it is a good idea
06ba4a61654b3763ad65f52283832ebf058fdf1cslive to arrange the files to reduce the size of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>vhosts</code> directory. To do this you might use the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive following in your configuration file:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive UseCanonicalName Off<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A request for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>http://www.domain.example.com/directory/file.html</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive will be satisfied by the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/example.com/d/o/m/domain/directory/file.html</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A more even spread of files can be achieved by hashing from the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive end of the name, for example: </p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The example request would come from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/example.com/n/i/a/domain/directory/file.html</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>Alternatively you might use: </p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The example request would come from
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/example.com/d/o/m/ain/directory/file.html</code>.</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>For IP-based virtual hosting you might use the following in
06ba4a61654b3763ad65f52283832ebf058fdf1cslive your configuration file:</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive UseCanonicalName DNS<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs<br />
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin
06ba4a61654b3763ad65f52283832ebf058fdf1cslive </code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A request for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>http://www.domain.example.com/directory/file.html</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive would be satisfied by the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/10/20/30/40/docs/directory/file.html</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive if the IP address of <code>www.domain.example.com</code> were
06ba4a61654b3763ad65f52283832ebf058fdf1cslive 10.20.30.40. A request for
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code>http://www.domain.example.com/cgi-bin/script.pl</code> would
06ba4a61654b3763ad65f52283832ebf058fdf1cslive be satisfied by executing the program
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/10/20/30/40/cgi-bin/script.pl</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>If you want to include the <code>.</code> character in a
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>VirtualDocumentRoot</code> directive, but it clashes with
97a9a944b5887e91042b019776c41d5dd74557aferikabele a <code>%</code> directive, you can work around the problem in
97a9a944b5887e91042b019776c41d5dd74557aferikabele the following way:</p>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<div class="example"><p><code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive VirtualDocumentRoot /usr/local/apache/vhosts/%2.0.%3.0
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</code></p></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>A request for
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>http://www.domain.example.com/directory/file.html</code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive will be satisfied by the file
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/usr/local/apache/vhosts/domain.example/directory/file.html</code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive"><a href="/mod/mod_log_config.html#logformat">LogFormat</a></code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directives <code>%V</code> and <code>%A</code> are useful
06ba4a61654b3763ad65f52283832ebf058fdf1cslive in conjunction with this module.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="directive-section"><h2><a name="VirtualDocumentRoot" id="VirtualDocumentRoot">VirtualDocumentRoot</a> <a name="virtualdocumentroot" id="virtualdocumentroot">Directive</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<table class="directive">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Dynamically configure the location of the document root
06ba4a61654b3763ad65f52283832ebf058fdf1cslivefor a given virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>VirtualDocumentRoot <em>interpolated-directory</em>|none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>VirtualDocumentRoot none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_vhost_alias</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</table>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive">VirtualDocumentRoot</code> directive allows you to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive determine where Apache will find your documents based on the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive value of the server name. The result of expanding
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <em>interpolated-directory</em> is used as the root of the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive document tree in a similar manner to the <code class="directive"><a href="/mod/core.html#documentroot">DocumentRoot</a></code> directive's argument.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive If <em>interpolated-directory</em> is <code>none</code> then
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code class="directive">VirtualDocumentRoot</code> is turned off. This directive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive cannot be used in the same context as <code class="directive"><a href="#virtualdocumentrootip">VirtualDocumentRootIP</a></code>.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="directive-section"><h2><a name="VirtualDocumentRootIP" id="VirtualDocumentRootIP">VirtualDocumentRootIP</a> <a name="virtualdocumentrootip" id="virtualdocumentrootip">Directive</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<table class="directive">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Dynamically configure the location of the document root
06ba4a61654b3763ad65f52283832ebf058fdf1cslivefor a given virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>VirtualDocumentRootIP <em>interpolated-directory</em>|none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>VirtualDocumentRootIP none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_vhost_alias</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</table>
97a9a944b5887e91042b019776c41d5dd74557aferikabele
97a9a944b5887e91042b019776c41d5dd74557aferikabele<p>The <code class="directive">VirtualDocumentRootIP</code> directive is like the
97a9a944b5887e91042b019776c41d5dd74557aferikabele <code class="directive"><a href="#virtualdocumentroot">VirtualDocumentRoot</a></code>
97a9a944b5887e91042b019776c41d5dd74557aferikabele directive, except that it uses the IP address of the server end
06ba4a61654b3763ad65f52283832ebf058fdf1cslive of the connection for directory interpolation instead of the server
06ba4a61654b3763ad65f52283832ebf058fdf1cslive name.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="directive-section"><h2><a name="VirtualScriptAlias" id="VirtualScriptAlias">VirtualScriptAlias</a> <a name="virtualscriptalias" id="virtualscriptalias">Directive</a></h2>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<table class="directive">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Dynamically configure the location of the CGI directory for
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nda given virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>VirtualScriptAlias <em>interpolated-directory</em>|none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>VirtualScriptAlias none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_vhost_alias</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive">VirtualScriptAlias</code> directive allows you to
06ba4a61654b3763ad65f52283832ebf058fdf1cslive determine where Apache will find CGI scripts in a similar
06ba4a61654b3763ad65f52283832ebf058fdf1cslive manner to <code class="directive"><a href="#virtualdocumentroot">VirtualDocumentRoot</a></code> does for other documents. It matches
06ba4a61654b3763ad65f52283832ebf058fdf1cslive requests for URIs starting <code>/cgi-bin/</code>, much like <code class="directive"><a href="/mod/mod_alias.html#scriptalias">ScriptAlias</a></code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code>/cgi-bin/</code> would.</p>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</div>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<div class="directive-section"><h2><a name="VirtualScriptAliasIP" id="VirtualScriptAliasIP">VirtualScriptAliasIP</a> <a name="virtualscriptaliasip" id="virtualscriptaliasip">Directive</a></h2>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<table class="directive">
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Dynamically configure the location of the cgi directory for
06ba4a61654b3763ad65f52283832ebf058fdf1cslivea given virtual host</td></tr>
97a9a944b5887e91042b019776c41d5dd74557aferikabele<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>VirtualScriptAliasIP <em>interpolated-directory</em>|none</code></td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>VirtualScriptAliasIP none</code></td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_vhost_alias</td></tr>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive</table>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <p>The <code class="directive">VirtualScriptAliasIP</code> directive is like the
06ba4a61654b3763ad65f52283832ebf058fdf1cslive <code class="directive"><a href="#virtualscriptalias">VirtualScriptAlias</a></code>
06ba4a61654b3763ad65f52283832ebf058fdf1cslive directive, except that it uses the IP address of the server end
06ba4a61654b3763ad65f52283832ebf058fdf1cslive of the connection for directory interpolation instead of the server
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd name.</p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<div class="bottomlang">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p><span>Available Languages: </span><a href="/en/mod/mod_vhost_alias.html" title="English">&nbsp;en&nbsp;</a></p>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</div><div id="footer">
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p class="apache">Copyright 1999-2004 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>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
0c4abc32c00611fe1d52c9661f5cc79a3f74c6d4nd</body></html>