205 lines
13 KiB
HTML
205 lines
13 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="topic" />
|
||
|
<meta name="DC.Title" content="Set up virtual hosts on HTTP Server (powered by Apache)" />
|
||
|
<meta name="abstract" content="This topic provides information about how to set up virtual hosts on your HTTP Server with the IBM Web Administration for i5/OS interface." />
|
||
|
<meta name="description" content="This topic provides information about how to set up virtual hosts on your HTTP Server with the IBM Web Administration for i5/OS interface." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzaieparvhost.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2002,2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2002,2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rzaieconfigvirtualhosts" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Set up virtual hosts on HTTP Server (powered by Apache)</title>
|
||
|
</head>
|
||
|
<body id="rzaieconfigvirtualhosts"><a name="rzaieconfigvirtualhosts"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Set up virtual hosts on HTTP Server (powered by Apache)</h1>
|
||
|
<div><p>This topic provides information about how to set up virtual hosts
|
||
|
on your HTTP Server with the <span>IBM<sup>®</sup> Web Administration for i5/OS™ interface</span>.</p>
|
||
|
<div class="important"><span class="importanttitle">Important:</span> Information
|
||
|
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
|
||
|
It is recommended that you install the latest PTFs to upgrade to the latest
|
||
|
level of the HTTP Server for i5/OS. Some of the topics documented here are
|
||
|
not available prior to this update. See <a href="http://www-03.ibm.com/servers/eserver/iseries/software/http/services/service.html" target="_blank">http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm</a> <img src="www.gif" alt="Link outside Information Center" /> for more information. </div>
|
||
|
<p>Virtual hosts allow more than one Web site on one system or Web server.
|
||
|
The servers are differentiated by their host name. Visitors to the Web site
|
||
|
are routed by host name or IP address to the correct virtual host. Virtual
|
||
|
hosting allows companies sharing one server to each have their own domain
|
||
|
names. For example, <var class="varname">www.company1.com</var> and <var class="varname">www.company2.com</var> can
|
||
|
both be hosted on the same server. See <a href="rzaievirtualhosting.htm">Virtual hosts on HTTP Server</a> for more information.</p>
|
||
|
<p>You can configure virtual hosts by doing the following:</p>
|
||
|
<ol><li>Click the <strong>Manage</strong> tab.</li>
|
||
|
<li>Click the <span class="uicontrol">HTTP Servers</span> subtab.</li>
|
||
|
<li>Select your HTTP Server (powered by Apache) from the <strong>Server</strong> list.</li>
|
||
|
<li>Select <strong>Global configuration</strong> from the <strong>Server area</strong> list.</li>
|
||
|
<li>Expand <strong>Server Properties</strong>.</li>
|
||
|
<li>Click <strong>Virtual Hosts</strong>.</li>
|
||
|
<li>Click either the <strong>Name-based</strong> virtual host tab or the <strong>IP-based</strong> virtual
|
||
|
host tab in the form.</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzaieparvhost.htm" title="This topic provides step-by-step tasks for virtual hosts.">Virtual host tasks</a></div>
|
||
|
</div>
|
||
|
</div><div class="nested1" id="namebased"><a name="namebased"><!-- --></a><h2 class="topictitle2">Name-based virtual hosts</h2>
|
||
|
<div><p>The name-based virtual host allows one IP address to host more than one
|
||
|
Web site (hostname). This approach allows a single HTTP Server to service
|
||
|
requests directed at many different hostnames. This simplifies configuration
|
||
|
and use, and requires no additional hardware or software. The main disadvantage
|
||
|
to this approach is that the client must support HTTP 1.1 (or HTTP 1.0 with
|
||
|
1.1 extensions) that include the server hostname information inside the HTTP
|
||
|
document requests. The latest versions of most browsers support HTTP 1.1 (or
|
||
|
HTTP 1.0 with 1.1 extensions), but there are still old browsers that only
|
||
|
support HTTP 1.0. For more information on virtual hosts refer to the <a href="rzaiemod_core.htm#virtualhost"><VirtualHost></a> directive.</p>
|
||
|
<ol><li>Click the <strong>Manage</strong> tab.</li>
|
||
|
<li>Click the <span class="uicontrol">HTTP Servers</span> subtab.</li>
|
||
|
<li>Select your HTTP Server (powered by Apache) from the <strong>Server</strong> list.</li>
|
||
|
<li>Select <strong>Global configuration</strong> from the <strong>Server area</strong> list.</li>
|
||
|
<li>Expand <strong>Server Properties</strong>.</li>
|
||
|
<li>Click <strong>Virtual Hosts</strong>.</li>
|
||
|
<li>Click the <strong>Name-based</strong> tab in the form.</li>
|
||
|
<li>Click <strong>Add</strong> under the <strong>Named virtual hosts</strong> table.</li>
|
||
|
<li>Select or enter an IP address in the <strong>IP address </strong>column.<div class="note"><span class="notetitle">Note:</span> The <span>IBM Web Administration for i5/OS interface</span> provides the IP addresses
|
||
|
used by your iSeries™ system
|
||
|
in the IP Address list; however, you will need to provide the hostname associated
|
||
|
with the address you choose and register the hostname with your Domain Name
|
||
|
Server (DNS).</div>
|
||
|
</li>
|
||
|
<li>Enter a port number in the <strong>Port</strong> column.</li>
|
||
|
<li>Click <strong>Add</strong> under the <strong>Virtual host containers</strong> table in the <strong>Named
|
||
|
host</strong> column.</li>
|
||
|
<li>Enter the fully qualified server hostname for the virtual host in the <strong>Server
|
||
|
name</strong> column.<div class="note"><span class="notetitle">Note:</span> Make sure the server hostname you enter is fully qualified
|
||
|
and associated with the IP address you selected.</div>
|
||
|
</li>
|
||
|
<li>Enter a document root for the virtual host index file or welcome file
|
||
|
in the <strong>Document root</strong> column.</li>
|
||
|
<li>Click <strong>Continue</strong>.</li>
|
||
|
<li>Click <strong>OK</strong>.</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="nested1" id="ipbased"><a name="ipbased"><!-- --></a><h2 class="topictitle2">IP-based virtual hosts</h2>
|
||
|
<div><p>The IP-based virtual host requires one IP address per Web site (host name).
|
||
|
This approach works very well, but requires a dedicated IP address for every
|
||
|
virtual host. For more information on virtual hosts refer to the <a href="rzaiemod_core.htm#virtualhost"><VirtualHost></a> directive.</p>
|
||
|
<ol><li>Click the <strong>Manage</strong> tab.</li>
|
||
|
<li>Click the <span class="uicontrol">HTTP Servers</span> subtab.</li>
|
||
|
<li>Select your HTTP Server (powered by Apache) from the <strong>Server</strong> list.</li>
|
||
|
<li>Select <strong>Global configuration</strong> from the <strong>Server area</strong> list.</li>
|
||
|
<li>Expand <strong>Server Properties</strong>.</li>
|
||
|
<li>Click <strong>Virtual Hosts</strong>.</li>
|
||
|
<li>Click the <strong>IP-based</strong> tab in the form.</li>
|
||
|
<li>Click <strong>Add</strong> under the <strong>Virtual host containers</strong> table.</li>
|
||
|
<li>Enter a valid IP address in the <strong>IP address or hostname</strong> column.</li>
|
||
|
<li>Enter a valid port number in the <strong>Port</strong> column. </li>
|
||
|
<li><strong>Optional</strong>: Enter a server name in the <strong>Server name</strong> column.</li>
|
||
|
<li><strong>Optional</strong>: Enter the document root from where the files will be
|
||
|
served in the <strong>Document root</strong> column.</li>
|
||
|
<li>Click <strong>Continue</strong>.</li>
|
||
|
<li>Click <strong>OK</strong>.</li>
|
||
|
</ol>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="nested1" id="massdynamic"><a name="massdynamic"><!-- --></a><h2 class="topictitle2">Mass-dynamic virtual hosting</h2>
|
||
|
<div><p>Use the Mass-dynamic tab to create a dynamic virtual host with a Name-based
|
||
|
or IP-based virtual host, or work with canonical names. A canonical name is
|
||
|
the actual name of an HTTP Server resource. For example, a canonical name
|
||
|
of the HTTP Server powered by Apache) is its true name rather than an alias.
|
||
|
See directive <a href="rzaiemod_core.htm#usecanonicalname"><UseCanonicalName></a> for more information.</p>
|
||
|
<p>The dynamic virtual host allows you to dynamically add Web sites (hostnames)
|
||
|
by adding directories of content. This approach is based on automatically
|
||
|
inserting the IP address and the contents of the Host: header into the pathname
|
||
|
of the file that is used to satisfy the request.</p>
|
||
|
<p>The Mass-dynamic tab provides a subset of options that are more complex
|
||
|
than those provided by the other tabs. The options include specifying the
|
||
|
root directory for serving files, and selecting the root directory for CGI
|
||
|
scripts. The availability of these settings are dependent on what server area
|
||
|
you are working with.</p>
|
||
|
<p>At the global configuration server area, all mass-dynamic settings are
|
||
|
available. These include:</p>
|
||
|
<ul><li>Options on how to build self-referencing URL's.</li>
|
||
|
<li>Options for the root directory for serving files.</li>
|
||
|
<li>Options for the root directory for CGI scripts.</li>
|
||
|
</ul>
|
||
|
<p>The mass-dynamic settings use strings and substrings to create a dynamic
|
||
|
virtual hosts. For example, to create a simple dynamic virtual host, the Root
|
||
|
directory for serving files option is defined as <tt><strong>/usr/local/apache/vhosts/%0</strong></tt> and <strong>Use
|
||
|
server name</strong> is selected. A request for <tt><strong>http://www.ibm.com/directory/file.html
|
||
|
returns</strong></tt> <tt><strong>/usr/local/apache/vhosts/www.ibm.com/directory/file.html</strong></tt>.
|
||
|
</p>
|
||
|
<p>The string <tt><strong>%0</strong></tt> is an interpolate (insert) string of the
|
||
|
server name or IP address. The following defines the interpolate string: </p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th colspan="2" valign="top" id="d0e345">Interpolate (insert) strings</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="15.736040609137056%" headers="d0e345 ">%%</td>
|
||
|
<td valign="top" width="84.26395939086294%" headers="d0e345 ">inserts a %</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="15.736040609137056%" headers="d0e345 ">%p</td>
|
||
|
<td valign="top" width="84.26395939086294%" headers="d0e345 ">inserts the port number of the virtual host</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="15.736040609137056%" headers="d0e345 ">%N.M</td>
|
||
|
<td valign="top" width="84.26395939086294%" headers="d0e345 ">inserts (part of) the name</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p><strong>N</strong> and<strong> M</strong> are used to specify substrings of the name. <strong>N</strong> selects
|
||
|
from the period-separated components of the name, and <strong>M</strong> selects characters
|
||
|
within whatever <strong>N</strong> has selected. <strong>M</strong> is optional and defaults to
|
||
|
zero if it is not present; the period must be present if and only if <strong>M</strong> is
|
||
|
present. The interpretation is as follows:</p>
|
||
|
|
||
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th colspan="2" valign="top" id="d0e391">Substring interpretation</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">0</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the whole name</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">1</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the first part</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">2</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the second part</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">-1</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the last part</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">-2</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the next to last part</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">2+</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the second and all subsequent parts</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">-2+</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the next to last part and all preceding parts</td>
|
||
|
</tr>
|
||
|
<tr><td valign="top" width="23.46938775510204%" headers="d0e391 ">1+ and -1+</td>
|
||
|
<td valign="top" width="76.53061224489795%" headers="d0e391 ">the same as 0</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<p>For more information on mass-dynamic virtual hosts refer to <a href="rzaiemod_vhost_alias.htm">mod_vhost_alias</a>.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
</body>
|
||
|
</html>
|