geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo v3.0 > Configuring Virtual Host in Tomcat
Date Thu, 27 Jan 2011 01:30:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2036/9/4/_/styles/combined.css?spaceKey=GMOxDOC30&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+Virtual+Host+in+Tomcat">Configuring Virtual Host in Tomcat</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~maojia508">maojia</a>
    </h4>
        <br/>
                         <h4>Changes (6)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h2. Define Virtual host <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Now you need to define those virtual hosts in Geronimo&#39;s {{config.xml}} file so that Geronimo can recognize them. This section provides two different virtual host definitions, one defined with multiple host names aliases and one without host names alias. The virtual hosts are defined by creating two new *HostGBean* ( _TomcatVirtualHost1_ and _TomcatVirtualHost2_ ) in the Geronimo configuration. The goal of this example is to have an application listen on a single virtual host ( virtualhost1.com ) and another application listen on a different virtual host ( virtualhost2.com <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">) with</span> <span class="diff-added-words"style="background-color: #dfd;">), which has</span> two <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">additional</span> aliases ( virtualhost3.com and virtualhost4.com ). <br></td></tr>
            <tr><td class="diff-unchanged" > <br>Open the {{config.xml}} file located in the {{&lt;geronimo_home&gt;/var}} directory and look for the following line {{&lt;module name=&quot;org.apache.geronimo.configs/tomcat6/2.2/car&quot;&gt;}}. This is the beginning of the Tomcat configuration module. All the additional virtual host configurations will be done immediately after this line. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >... <br>{code} <br></td></tr>
            <tr><td class="diff-changed-lines" >To add the second HostGBean *TomcatVirtualHost_2*, add the following lines right after the first HostGBean. These two HostGBeans have been split so that it is easier to identify them. The main difference between these two <span class="diff-added-words"style="background-color: #dfd;">HostGBeans</span> is the {{*&lt;attribute name=&quot;aliases&quot;&gt;..,..&lt;/attribute&gt;*}} line that defines the aliases. <br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml|borderStyle=solid|title=Excerpt from config.xml} <br>... <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >... <br>{code} <br></td></tr>
            <tr><td class="diff-changed-lines" >At this point, you have successfully configured two different virtual hosts in Geronimo. Make sure that you save the changes to the {{config.xml}} file and <span class="diff-added-words"style="background-color: #dfd;">then</span> [start|Tools and commands#startup] Geronimo. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-changed-lines" >For additional reference, <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">this is an</span> <span class="diff-added-words"style="background-color: #dfd;">see the following</span> excerpt from {{config.xml}} of the entire {{&lt;module name=&quot;org.apache.geronimo.configs/tomcat6/2.2/car&quot;&gt;}} entry with the two *HostGBean* already defined. <br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml|borderStyle=solid|title=config.xml} <br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >                    + web.xml <br>{noformat} <br></td></tr>
            <tr><td class="diff-changed-lines" >Open the {{geronimo-web.xml}} file and edit the *artifactId* and *context-root* to make this deployment unique. Within the *&lt;web-app&gt;* <span class="diff-changed-words">section<span class="diff-added-chars"style="background-color: #dfd;">,</span></span> add the *host* attribute and specify the Virtual Host <span class="diff-changed-words"><span class="diff-added-chars"style="background-color: #dfd;">that</span>you</span> want this application to listen on, in this case {{virtualhost1.com}}. <br></td></tr>
            <tr><td class="diff-unchanged" >{code:xml|borderStyle=solid|title=geronimo-web.xml for HelloWorld_1} <br>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >*{{jar \-cvf HelloWorld_1.war \*}}* <br> <br></td></tr>
            <tr><td class="diff-changed-lines" >Once <span class="diff-changed-words">deployed<span class="diff-added-chars"style="background-color: #dfd;">,</span></span> this application should only listed in the *virtualhost1.com* host name. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>We will now repeat this steps to create a second WAR. Edit once again the {{geronimo-web.xml}} file and copy the content form the following example. Note that we are only changing the *&lt;artifactId&gt;*, *&lt;context-root&gt;* and *&lt;host&gt;*. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p><style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color: #f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td class='ScrollbarPrevIcon'><a href="/confluence/display/GMOxDOC30/Configuring+Virtual+Host+in+Jetty"><img border='0' align='middle' src='/confluence/images/icons/back_16.gif' width='16' height='16'></a></td><td width='33%' class='ScrollbarPrevName'><a href="/confluence/display/GMOxDOC30/Configuring+Virtual+Host+in+Jetty">Configuring Virtual Host in Jetty</a>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a href="/confluence/display/GMOxDOC30/Configuring+virtual+host"><img border='0' align='middle' src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a href="/confluence/display/GMOxDOC30/Configuring+virtual+host">Configuring virtual host</a></td><td width='33%' class='ScrollbarNextName'>&nbsp;</td></tr></table></div>This article shows how to configure Virtual Hosts in Apache Geronimo with Tomcat. By default, when you deploy and start an application in Geronimo, that application will be listening on every available host name. By configuring a virtual host, you can make an application listen on a specific host name or IP. The configuration steps described in this article are also valid when you are sharing a single IP among several host names.<br/>
To configure a virtual host in Geronimo, you basically need to do the following actions:</p>
<div>
<ul>
    <li><a href='#ConfiguringVirtualHostinTomcat-ConfigurelocalhostorDNS'>Configure local host or DNS</a></li>
    <li><a href='#ConfiguringVirtualHostinTomcat-DefineVirtualhost'>Define Virtual host</a></li>
    <li><a href='#ConfiguringVirtualHostinTomcat-Declarethevirtualhostinthedeploymentplan'>Declare the virtual host in the deployment plan</a></li>
    <li><a href='#ConfiguringVirtualHostinTomcat-Deploytheapplication'>Deploy the application</a></li>
</ul></div>
<p>This article used the simple HelloWorld application as a reference. This application is covered in the <a href="/confluence/display/GMOxDOC30/Quick+start+-+Apache+Geronimo+for+the+impatient" title="Quick start - Apache Geronimo for the impatient">Quick start - Apache Geronimo for the impatient</a> section.</p>

<h2><a name="ConfiguringVirtualHostinTomcat-ConfigurelocalhostorDNS"></a>Configure local host or DNS</h2>

<p>To make this configuration work, you need to ensure that Geronimo can resolve the virtual host name you are about to define. Depending on your network configuration, you can add an entry to your DNS, or an alias to the Geronimo server IP. Alternatively, you can add an entry to the local host table. Each operating system has its own way to define a local host table. For example Windows will have <tt>%SystemRoot%\system32\drivers\etc\hosts</tt>, and UNIX based operating systems would normally have an <tt>/etc/hosts</tt>.</p>

<p>For this example we will be using the following host names defined in the local host table:</p>

<p><tt><b>127.0.0.1    localhost    virtualhost1.com    virtualhost2.com    virtualhost3.com    virtualhost4.com</b></tt></p>

<p>Make sure that your system can resolve these names.</p>

<h2><a name="ConfiguringVirtualHostinTomcat-DefineVirtualhost"></a>Define Virtual host</h2>

<p>Now you need to define those virtual hosts in Geronimo's <tt>config.xml</tt> file so that Geronimo can recognize them. This section provides two different virtual host definitions, one defined with multiple host names aliases and one without host names alias. The virtual hosts are defined by creating two new <b>HostGBean</b> ( <em>TomcatVirtualHost1</em> and <em>TomcatVirtualHost2</em> ) in the Geronimo configuration. The goal of this example is to have an application listen on a single virtual host ( virtualhost1.com ) and another application listen on a different virtual host ( virtualhost2.com ), which has two aliases ( virtualhost3.com and virtualhost4.com ).</p>

<p>Open the <tt>config.xml</tt> file located in the <tt>&lt;geronimo_home&gt;/var</tt> directory and look for the following line <tt>&lt;module name="org.apache.geronimo.configs/tomcat6/2.2/car"&gt;</tt>. This is the beginning of the Tomcat configuration module. All the additional virtual host configurations will be done immediately after this line.</p>

<p>To define the first HostGBean <b>TomcatVirtualHost_1</b>, add the following lines right after <tt>&lt;module name="org.apache.geronimo.configs/tomcat6/2.2/car"&gt;</tt>.</p>
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Excerpt from config.xml</b></div><div class="codeContent panelContent">
<pre class="code-xml">
...
&lt;gbean gbeanInfo=<span class="code-quote">"org.apache.geronimo.tomcat.HostGBean"</span>
    name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6/2.2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.2/car,j2eeType=Host,name=TomcatVirtualHost_1"</span>&gt;
    <span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.core.StandardHost<span class="code-tag">&lt;/attribute&gt;</span>
    <span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>name=virtualhost1.com
       appBase=
       workDir=work<span class="code-tag">&lt;/attribute&gt;</span>
    <span class="code-tag">&lt;reference name=<span class="code-quote">"Engine"</span>&gt;</span>
        <span class="code-tag">&lt;pattern&gt;</span>
            <span class="code-tag">&lt;name&gt;</span>TomcatEngine<span class="code-tag">&lt;/name&gt;</span>
        <span class="code-tag">&lt;/pattern&gt;</span>
    <span class="code-tag">&lt;/reference&gt;</span>
<span class="code-tag">&lt;/gbean&gt;</span>
...
</pre>
</div></div>
<p>To add the second HostGBean <b>TomcatVirtualHost_2</b>, add the following lines right after the first HostGBean. These two HostGBeans have been split so that it is easier to identify them. The main difference between these two HostGBeans is the <tt><b>&lt;attribute name="aliases"&gt;..,..&lt;/attribute&gt;</b></tt> line that defines the aliases.</p>
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>Excerpt from config.xml</b></div><div class="codeContent panelContent">
<pre class="code-xml">
...
&lt;gbean gbeanInfo=<span class="code-quote">"org.apache.geronimo.tomcat.HostGBean"</span>
    name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6/2.2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.2/car,j2eeType=Host,name=TomcatVirtualHost_2"</span>&gt;
    <span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.core.StandardHost<span class="code-tag">&lt;/attribute&gt;</span>
    <span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>name=virtualhost2.com
       appBase=
       workDir=work<span class="code-tag">&lt;/attribute&gt;</span>
       <span class="code-tag">&lt;attribute name=<span class="code-quote">"aliases"</span>&gt;</span>virtualhost3.com,virtualhost4.com<span class="code-tag">&lt;/attribute&gt;</span>
    <span class="code-tag">&lt;reference name=<span class="code-quote">"Engine"</span>&gt;</span>
        <span class="code-tag">&lt;pattern&gt;</span>
            <span class="code-tag">&lt;name&gt;</span>TomcatEngine<span class="code-tag">&lt;/name&gt;</span>
        <span class="code-tag">&lt;/pattern&gt;</span>
    <span class="code-tag">&lt;/reference&gt;</span>
<span class="code-tag">&lt;/gbean&gt;</span>
...
</pre>
</div></div>
<p>At this point, you have successfully configured two different virtual hosts in Geronimo. Make sure that you save the changes to the <tt>config.xml</tt> file and then <a href="/confluence/display/GMOxDOC30/Tools+and+commands#Toolsandcommands-startup">start</a> Geronimo.</p>

<p>For additional reference, see the following excerpt from <tt>config.xml</tt> of the entire <tt>&lt;module name="org.apache.geronimo.configs/tomcat6/2.2/car"&gt;</tt> entry with the two <b>HostGBean</b> already defined.</p>
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>config.xml</b></div><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span> standalone=<span class="code-quote">"yes"</span>?&gt;</span>
<span class="code-tag">&lt;attributes <span class="code-keyword">xmlns:ns2</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/plugins-1.3"</span> xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/attributes-1.2"</span>&gt;</span>
    <span class="code-tag">&lt;comment&gt;</span>
==================================================================
Warning - This XML file is regenerated by Geronimo whenever
changes are made to Geronimo's configuration.

If you want to include comments, create a single comment element
element.  They are allowable at any level of the configuration.

!!!! Do not edit this file while Geronimo is running !!!!
==================================================================<span class="code-tag">&lt;/comment&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/j2ee-security/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"JMXService"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"protocol"</span>&gt;</span>rmi<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${JMXPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"urlPath"</span>&gt;</span>/jndi/rmi://${ServerHostname}:${NamingPort + PortOffset}/JMXConnector<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/rmi-naming/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"RMIRegistry"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${NamingPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"NamingProperties"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"namingProviderUrl"</span>&gt;</span>rmi://${ServerHostname}:${NamingPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultThreadPool"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"keepAliveTime"</span>&gt;</span>30000<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"minPoolSize"</span>&gt;</span>${MinThreadPoolSize}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"maxPoolSize"</span>&gt;</span>${MaxThreadPoolSize}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/j2ee-system/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/jee-specs/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/shutdown/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/client-system/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/online-deployer/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/transformer-agent/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/server-security-config/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/plugin/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DownloadedPluginRepos"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"repositoryList"</span>&gt;</span>http://geronimo.apache.org/plugins/plugin-repository-list-2.2.txt<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"userRepositories"</span>&gt;</span>~/.m2/repository<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/xmlbeans/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/myfaces-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/myfaces/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/j2ee-server/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/j2ee-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"WebBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"defaultNamespace"</span>&gt;</span>http://geronimo.apache.org/xml/ns/j2ee/web/jetty-2.0<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"EnvironmentEntryBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/geronimo-gbean-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"Deployer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"remoteDeployAddress"</span>&gt;</span>http://${RemoteDeployHostname}:${HTTPPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/activemq-ra/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ActiveMQ RA"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"ServerUrl"</span>&gt;</span>tcp://${ServerHostname}:${ActiveMQPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/activemq-broker/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ActiveMQ.tcp.default"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${ActiveMQPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ActiveMQ.stomp.default"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${ActiveMQStompPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/system-database/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DerbyNetwork"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${DerbyPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/transaction/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ResourceBindings"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"format"</span>&gt;</span>${ResourceBindingsFormat}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"nameInNamespace"</span>&gt;</span>${ResourceBindingsNameInNamespace}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"namePattern"</span>&gt;</span>${ResourceBindingsNamePattern}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"abstractNameQuery"</span>&gt;</span>${ResourceBindingsQuery}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/uddi-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/webservices-common/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"EJBNetworkService"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${OpenEJBPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openjpa/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jasper/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6/2.2/car"</span>&gt;</span>

        <span class="code-tag"><span class="code-comment">&lt;!-- Virtual Host 1 definition --&gt;</span></span>
        &lt;gbean name="org.apache.geronimo.configs/tomcat6/2.2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.2/car,
        j2eeType=Host,name=TomcatVirtualHost_1<span class="code-quote">" gbeanInfo="</span>org.apache.geronimo.tomcat.HostGBean"&gt;
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.core.StandardHost<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>name=virtualhost1.com
			                 appBase=
                                         workDir=work<span class="code-tag">&lt;/attribute&gt;</span>
           <span class="code-tag">&lt;reference name=<span class="code-quote">"Engine"</span>&gt;</span>
                <span class="code-tag">&lt;pattern&gt;</span>
                    <span class="code-tag">&lt;name&gt;</span>TomcatEngine<span class="code-tag">&lt;/name&gt;</span>
                <span class="code-tag">&lt;/pattern&gt;</span>
           <span class="code-tag">&lt;/reference&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>

        <span class="code-tag"><span class="code-comment">&lt;!-- Virtual Host 2 and aliases definition --&gt;</span></span>
        &lt;gbean name="org.apache.geronimo.configs/tomcat6/2.2/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.2/car,
        j2eeType=Host,name=TomcatVirtualHost_2<span class="code-quote">" gbeanInfo="</span>org.apache.geronimo.tomcat.HostGBean"&gt;
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"className"</span>&gt;</span>org.apache.catalina.core.StandardHost<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"initParams"</span>&gt;</span>name=virtualhost2.com
			                 appBase=
                                         workDir=work<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"aliases"</span>&gt;</span>virtualhost3.com,virtualhost4.com<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;reference name=<span class="code-quote">"Engine"</span>&gt;</span>
                <span class="code-tag">&lt;pattern&gt;</span>
                    <span class="code-tag">&lt;name&gt;</span>TomcatEngine<span class="code-tag">&lt;/name&gt;</span>
                <span class="code-tag">&lt;/pattern&gt;</span>
           <span class="code-tag">&lt;/reference&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/connector-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ResourceRefBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span> name=<span class="code-quote">"corbaEnvironment"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment <span class="code-keyword">xmlns:environment</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
                    <span class="code-tag">&lt;environment:dependencies&gt;</span>
                        <span class="code-tag">&lt;environment:dependency&gt;</span>
                            <span class="code-tag">&lt;environment:groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/environment:groupId&gt;</span>
                            <span class="code-tag">&lt;environment:artifactId&gt;</span>j2ee-corba-yoko<span class="code-tag">&lt;/environment:artifactId&gt;</span>
                            <span class="code-tag">&lt;environment:type&gt;</span>car<span class="code-tag">&lt;/environment:type&gt;</span>
            <span class="code-tag">&lt;/environment:dependency&gt;</span>
          <span class="code-tag">&lt;/environment:dependencies&gt;</span>
        <span class="code-tag">&lt;/environment:environment&gt;</span><span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"AdminObjectRefBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ClientResourceRefBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span> name=<span class="code-quote">"corbaEnvironment"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment <span class="code-keyword">xmlns:environment</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
                    <span class="code-tag">&lt;environment:dependencies&gt;</span>
                        <span class="code-tag">&lt;environment:dependency&gt;</span>
                            <span class="code-tag">&lt;environment:groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/environment:groupId&gt;</span>
                            <span class="code-tag">&lt;environment:artifactId&gt;</span>client-corba-yoko<span class="code-tag">&lt;/environment:artifactId&gt;</span>
                            <span class="code-tag">&lt;environment:type&gt;</span>car<span class="code-tag">&lt;/environment:type&gt;</span>
            <span class="code-tag">&lt;/environment:dependency&gt;</span>
          <span class="code-tag">&lt;/environment:dependencies&gt;</span>
        <span class="code-tag">&lt;/environment:environment&gt;</span><span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis2/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jasper-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/remote-deploy-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client-security/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    &lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis2-ejb-deployer/2.2/car"</span> condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat6')"&gt;
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"Axis2ModuleBuilderExtension"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"listener"</span>&gt;</span>?name=${webcontainer}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jaxws-ejb-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jaxws-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"EjbRefBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ClientEjbRefBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"eeNamespaces"</span>&gt;</span>http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ServerHostname}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${OpenEJBPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    &lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis2-deployer/2.2/car"</span> condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat6')"/&gt;
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis2-ejb/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/ca-helper-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/agent/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/agent-ds/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/mejb/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6-clustering-builder-wadi/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"TomcatClusteringBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"defaultSweepInterval"</span>&gt;</span>${DefaultWadiSweepInterval}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"defaultNumPartitions"</span>&gt;</span>${DefaultWadiNumPartitions}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/tomcat6-clustering-wadi/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/wadi-clustering/2.2/car"</span> load=<span class="code-quote">"false"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultBackingStrategyFactory"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"nbReplica"</span>&gt;</span>${ReplicaCount}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DefaultDispatcherHolder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"endPointURI"</span>&gt;</span>${EndPointURI}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"clusterName"</span>&gt;</span>${ClusterName}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/clustering/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"Node"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"nodeName"</span>&gt;</span>${clusterNodeName}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/debugviews-console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/pluto-support/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/spring/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/dojo-legacy-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/persistence-jpa10-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"PersistenceUnitBuilder"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"defaultPersistenceProviderClassName"</span>&gt;</span>org.apache.openjpa.persistence.PersistenceProviderImpl<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"defaultPersistenceUnitProperties"</span>&gt;</span>openjpa.Log=commons
                                        openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
                                        openjpa.jdbc.UpdateManager=operation-order
                                        openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span> name=<span class="code-quote">"defaultEnvironment"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment <span class="code-keyword">xmlns:environment</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
                    <span class="code-tag">&lt;environment:dependencies&gt;</span>
                        <span class="code-tag">&lt;environment:dependency&gt;</span>
                            <span class="code-tag">&lt;environment:groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/environment:groupId&gt;</span>
                            <span class="code-tag">&lt;environment:artifactId&gt;</span>openjpa<span class="code-tag">&lt;/environment:artifactId&gt;</span>
                            <span class="code-tag">&lt;environment:type&gt;</span>car<span class="code-tag">&lt;/environment:type&gt;</span>
            <span class="code-tag">&lt;/environment:dependency&gt;</span>
          <span class="code-tag">&lt;/environment:dependencies&gt;</span>
        <span class="code-tag">&lt;/environment:environment&gt;</span><span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/plugin-console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/plancreator-console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/upgrade-cli/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"AxisModuleBuilderExtension"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"listener"</span>&gt;</span>?name=${webcontainer}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span> name=<span class="code-quote">"defaultEnvironment"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment <span class="code-keyword">xmlns:environment</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;</span>
                    <span class="code-tag">&lt;environment:dependencies&gt;</span>
                        <span class="code-tag">&lt;environment:dependency&gt;</span>
                            <span class="code-tag">&lt;environment:groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/environment:groupId&gt;</span>
                            <span class="code-tag">&lt;environment:artifactId&gt;</span>${webcontainerName}<span class="code-tag">&lt;/environment:artifactId&gt;</span>
                            <span class="code-tag">&lt;environment:type&gt;</span>car<span class="code-tag">&lt;/environment:type&gt;</span>
            <span class="code-tag">&lt;/environment:dependency&gt;</span>
          <span class="code-tag">&lt;/environment:dependencies&gt;</span>
        <span class="code-tag">&lt;/environment:environment&gt;</span><span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/j2ee-corba-yoko/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"NameServer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${COSNamingPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${COSNamingHost}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"Server"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${ORBSSLPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ORBSSLHost}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"UnprotectedServer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${ORBPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${ORBHost}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/hot-deployer/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"HotDeployer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"path"</span>&gt;</span>deploy/<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"pollIntervalMillis"</span>&gt;</span>2000<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/farming/2.2/car"</span> load=<span class="code-quote">"false"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"NodeInfo"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"name"</span>&gt;</span>${clusterNodeName}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"ClusterInfo"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"name"</span>&gt;</span>${clusterName}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/sysdb-console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/offline-deployer/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb-corba-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/activemq-console-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client-corba-yoko/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/javamail/2.2/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"SMTPTransport"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"host"</span>&gt;</span>${SMTPHost}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"port"</span>&gt;</span>${SMTPPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    &lt;module name=<span class="code-quote">"org.apache.geronimo.configs/cxf-deployer/2.2/car"</span> condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'jetty6')"/&gt;
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/cxf/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/welcome-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/sharedlib/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/mconsole-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/mconsole-ds/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client-deployer/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client-transaction/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    &lt;module name=<span class="code-quote">"org.apache.geronimo.configs/cxf-ejb-deployer/2.2/car"</span> condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'jetty6')"&gt;
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"CXFModuleBuilderExtension"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"listener"</span>&gt;</span>?name=${webcontainer}<span class="code-tag">&lt;/attribute&gt;</span>
        <span class="code-tag">&lt;/gbean&gt;</span>
    <span class="code-tag">&lt;/module&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/cxf-ejb/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/dojo-tomcat/2.2/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jsr88-ear-configurer/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jsr88-jar-configurer/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jsr88-war-configurer/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/jsr88-deploymentfactory/2.2/car"</span> load=<span class="code-quote">"false"</span>/&gt;</span>
<span class="code-tag">&lt;/attributes&gt;</span>
</pre>
</div></div>
<p><b>Note:</b> Some tags in the <tt>config.xml</tt> shown above are presented in multiple lines for displaying purposes only.</p>

<h2><a name="ConfiguringVirtualHostinTomcat-Declarethevirtualhostinthedeploymentplan"></a>Declare the virtual host in the deployment plan</h2>

<p>As mentioned before, for this example we are using the HelloWorld sample application covered in the <a href="/confluence/display/GMOxDOC30/Quick+start+-+Apache+Geronimo+for+the+impatient" title="Quick start - Apache Geronimo for the impatient">Quick start - Apache Geronimo for the impatient</a> section. Since this is a Web application, the deployment plan that we are modifying is the <tt>geronimo-web.xml</tt>. If you use a different type of application you may need to modify a different deployment plan, for example <tt>geronimo-application.xml</tt>.</p>

<p>In the previous section we defined two Virtual Hosts, now we will be configuring two applications so they can be deployed to those Virtual Hosts exclusively.</p>

<p>We will use the same application in both cases but will differentiate one deployment from the other by giving it a different <b>artifactId</b>, this way we avoid modifying the code but still can identify each deployment.</p>

<p>Assuming you followed the steps covered in the <a href="/confluence/display/GMOxDOC30/Quick+start+-+Apache+Geronimo+for+the+impatient" title="Quick start - Apache Geronimo for the impatient">Quick start - Apache Geronimo for the impatient</a> section you should have the following structure:</p>
<div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent">
<pre>&lt;APP_HOME&gt;\
          + HelloWorld.jsp
          + WEB-INF\
                    + geronimo-web.xml
                    + web.xml
</pre>
</div></div>
<p>Open the <tt>geronimo-web.xml</tt> file and edit the <b>artifactId</b> and <b>context-root</b> to make this deployment unique. Within the <b>&lt;web-app&gt;</b> section, add the <b>host</b> attribute and specify the Virtual Host thatyou want this application to listen on, in this case <tt>virtualhost1.com</tt>.</p>
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml for HelloWorld_1</b></div><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
<span class="code-tag">&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-1.2"</span>&gt;</span>
    <span class="code-tag">&lt;environment&gt;</span>
        <span class="code-tag">&lt;moduleId&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>sample.applications<span class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>HelloWorldApp_1<span class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
            <span class="code-tag">&lt;type&gt;</span>war<span class="code-tag">&lt;/type&gt;</span>
        <span class="code-tag">&lt;/moduleId&gt;</span>
    <span class="code-tag">&lt;/environment&gt;</span>
    <span class="code-tag">&lt;context-root&gt;</span>/hello_1<span class="code-tag">&lt;/context-root&gt;</span>
    <span class="code-tag">&lt;host&gt;</span>virtualhost1.com<span class="code-tag">&lt;/host&gt;</span>
<span class="code-tag">&lt;/web-app&gt;</span>
</pre>
</div></div>
<p>Save the changed to the <tt>geronimo-web.xml</tt> file and generate a WAR file by typing the following command from the <tt>&lt;APP_HOME&gt;</tt> directory:</p>

<p><b><tt>jar &#45;cvf HelloWorld_1.war &#42;</tt></b></p>

<p>Once deployed, this application should only listed in the <b>virtualhost1.com</b> host name.</p>

<p>We will now repeat this steps to create a second WAR. Edit once again the <tt>geronimo-web.xml</tt> file and copy the content form the following example. Note that we are only changing the <b>&lt;artifactId&gt;</b>, <b>&lt;context-root&gt;</b> and <b>&lt;host&gt;</b>.</p>
<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml for HelloWorld_2</b></div><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;</span>
<span class="code-tag">&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-1.2"</span>&gt;</span>
    <span class="code-tag">&lt;environment&gt;</span>
        <span class="code-tag">&lt;moduleId&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>sample.applications<span class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>HelloWorldApp_2<span class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>2.2<span class="code-tag">&lt;/version&gt;</span>
            <span class="code-tag">&lt;type&gt;</span>war<span class="code-tag">&lt;/type&gt;</span>
        <span class="code-tag">&lt;/moduleId&gt;</span>
    <span class="code-tag">&lt;/environment&gt;</span>
    <span class="code-tag">&lt;context-root&gt;</span>/hello_2<span class="code-tag">&lt;/context-root&gt;</span>
    <span class="code-tag">&lt;host&gt;</span>virtualhost2.com<span class="code-tag">&lt;/host&gt;</span>
<span class="code-tag">&lt;/web-app&gt;</span>
</pre>
</div></div>
<p>Save the changed to the <tt>geronimo-web.xml</tt> file and generate a second WAR file by typing the following command from the <tt>&lt;APP_HOME&gt;</tt> directory:</p>

<p>*<tt>jar &#45;cvf HelloWorld_2.war&#42;</tt> *</p>

<p>You now have two applications ready to be deployed to two different virtual hosts.</p>

<h2><a name="ConfiguringVirtualHostinTomcat-Deploytheapplication"></a>Deploy the application</h2>

<p>At this point you have configured Geronimo to use two different Virtual Hosts, one of them is also configured to listen under additional aliases. All you need to do now is to deploy the applications and test them. To deploy the applications type the following commands from the <tt>&lt;GERONIMO_HOME&gt;\bin</tt> directory:</p>

<p><tt><b>deploy &#45;-user system &#45;-password manager deploy &lt;APP_HOME&gt;\HelloWorld_1.war</b></tt></p>

<p>You should get a successful confirmation message similar to this one:</p>

<p><font color="white">
<div class="preformatted panel" style="background-color: #000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent" style="background-color: #000000;">
<pre>D:\geronimo-tomcat6-jee5-2.2\bin&gt;deploy --user system --password manager deploy \HelloWorld_2.2\HelloWorld_1.war
Using GERONIMO_BASE:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_HOME:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_TMPDIR: var\temp
Using JRE_HOME:        C:\Java\jdk1.5.0_06\jre
    Deployed sample.applications/HelloWorldApp_1/2.2/war @/hello_1
</pre>
</div></div></font></p>

<p>Repeat the deployment for the second application.</p>

<p><tt><b>deploy &#45;-user system &#45;-password manager deploy &lt;APP_HOME&gt;\HelloWorld_2.war</b></tt></p>

<p>You should get a successful confirmation message similar to this one:</p>

<p><font color="white">
<div class="preformatted panel" style="background-color: #000000;border-style: solid;border-width: 1px;"><div class="preformattedContent panelContent" style="background-color: #000000;">
<pre>D:\geronimo-tomcat6-jee5-2.2\bin&gt;deploy --user system --password manager deploy \HelloWorld_2.2\HelloWorld_2.war
Using GERONIMO_BASE:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_HOME:   D:\geronimo-tomcat6-jee5-2.2
Using GERONIMO_TMPDIR: var\temp
Using JRE_HOME:        C:\Java\jdk1.5.0_06\jre
    Deployed sample.applications/HelloWorldApp_2/2.2/war @/hello_2
</pre>
</div></div></font></p>

<p>With the applications deployed the only thing left is to test them. Test <b>hello_1</b> first, try to access the hosts names defined on the Geronimo server machine:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Host name / Virtual Host </th>
<th class='confluenceTh'> Access </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://localhost:8080/hello_1" class="external-link" rel="nofollow">http://localhost:8080/hello_1</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost1.com:8080/hello_1" class="external-link" rel="nofollow">http://virtualhost1.com:8080/hello_1</a> </td>
<td class='confluenceTd'> <b>SUCCESS&#33;&#33;&#33;</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost2.com:8080/hello_1" class="external-link" rel="nofollow">http://virtualhost2.com:8080/hello_1</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost3.com:8080/hello_1" class="external-link" rel="nofollow">http://virtualhost3.com:8080/hello_1</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost4.com:8080/hello_1" class="external-link" rel="nofollow">http://virtualhost4.com:8080/hello_1</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
</tbody></table>
</div>

<p>Now repeat the tests for <b>hello_2</b>.</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Host name / Virtual Host </th>
<th class='confluenceTh'> Access </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://localhost:8080/hello_2" class="external-link" rel="nofollow">http://localhost:8080/hello_2</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost1.com:8080/hello_2" class="external-link" rel="nofollow">http://virtualhost1.com:8080/hello_2</a> </td>
<td class='confluenceTd'> Fail </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost2.com:8080/hello_2" class="external-link" rel="nofollow">http://virtualhost2.com:8080/hello_2</a> </td>
<td class='confluenceTd'> <b>SUCCESS&#33;&#33;&#33;</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost3.com:8080/hello_2" class="external-link" rel="nofollow">http://virtualhost3.com:8080/hello_2</a> </td>
<td class='confluenceTd'> <b>SUCCESS&#33;&#33;&#33;</b> </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="http://virtualhost4.com:8080/hello_2" class="external-link" rel="nofollow">http://virtualhost4.com:8080/hello_2</a> </td>
<td class='confluenceTd'> <b>SUCCESS&#33;&#33;&#33;</b> </td>
</tr>
</tbody></table>
</div>

<p>Congratulations&#33;&#33;&#33; you have successfully configured and deployed two applications to two different virtual hosts and aliases.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+Virtual+Host+in+Tomcat">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20645459&revisedVersion=3&originalVersion=2">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/GMOxDOC30/Configuring+Virtual+Host+in+Tomcat?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message