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 Tue, 06 Mar 2012 16:42:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/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/~rglaue">Russell E Glaue</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Updated to account for the three methods of configuring Tomcat Virtual Hosts: config.xml, server.xml, and GBean.<br />
    </div>
        <br/>
                         <h4>Changes (2)</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-added-lines" style="background-color: #dfd;">There are three approaches to defining a virtual host in Geronimo: <br># Manually by directly editing Geronimo&#39;s {{var/config/config.xml}} to set the definition. Requires a restart of Geronimo. <br># Automatically by deploying a GBean which contains the definition. *Does not* require a restart of Geronimo. <br># Manually by editing Tomcat Catalina&#39;s {{var/catalina/server.xml}} to set the definition. Requires a restart of Geronimo. <br> <br>We will cover the first two options which are specific to Geronimo&#39;s methodology of configuration. Instructions on performing the third option can be found in documentation on the Apache Tomcat project web site. <br> <br>h3. Manually editing {{var/config/config.xml}} <br> <br></td></tr>
            <tr><td class="diff-unchanged" >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 ), which has two aliases ( virtualhost3.com and virtualhost4.com ). <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >*Note:* Some tags in this {{config.xml}} excerpt shown here are presented in multiple lines for displaying purposes only. <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h3. Deploying a GBean configuration <br> <br>First create the GBean. Note the formatting of the {{&lt;attribute name=&quot;initParams&quot;&gt;}} element which must be left as seen. <br> <br>{code:title=gbean-Virtualhost1_com.xml} <br>&lt;module xmlns=&quot;http://geronimo.apache.org/xml/ns/deployment-1.2&quot;&gt; <br>    &lt;environment&gt; <br>        &lt;moduleId&gt; <br>            &lt;groupId&gt;org.example.configs.virtualhosts&lt;/groupId&gt; <br>            &lt;artifactId&gt;virtualhost1&lt;/artifactId&gt; <br>            &lt;version&gt;1.0&lt;/version&gt; <br>            &lt;type&gt;car&lt;/type&gt; <br>        &lt;/moduleId&gt; <br>        &lt;dependencies&gt; <br>            &lt;dependency&gt; <br>                &lt;groupId&gt;org.apache.geronimo.configs&lt;/groupId&gt; <br>                &lt;artifactId&gt;tomcat7&lt;/artifactId&gt; <br>                &lt;type&gt;car&lt;/type&gt; <br>            &lt;/dependency&gt; <br>        &lt;/dependencies&gt; <br>        &lt;hidden-classes/&gt; <br>        &lt;non-overridable-classes/&gt; <br>    &lt;/environment&gt; <br>    &lt;gbean name=&quot;TomcatVirtualHost_1&quot; class=&quot;org.apache.geronimo.tomcat.HostGBean&quot;&gt; <br>        &lt;attribute name=&quot;className&quot;&gt;org.apache.catalina.core.StandardHost&lt;/attribute&gt; <br>        &lt;attribute name=&quot;initParams&quot;&gt;name=virtualhost1.com <br>                                     appBase= <br>                                     workDir=work&lt;/attribute&gt; <br>        &lt;reference name=&quot;Engine&quot;&gt; <br>            &lt;name&gt;TomcatEngine&lt;/name&gt; <br>        &lt;/reference&gt; <br>    &lt;/gbean&gt; <br>&lt;/module&gt; <br>{code} <br> <br>Deploy the GBean to your Geronimo server. <br>* For a single server with no instances: <br>** {{{*}deploy \--user system \--password manager deploy gbean-Virtualhost1_com.xml{*}}} <br>* For a server with multiple instances: <br>** {{{*}deploy \--user system \--password manager --port &lt;RMI_port&gt; deploy --targets &lt;instance_repo_target&gt; gbean-Virtualhost1_com.xml{*}}} <br> <br>{code:title=Example deploy} <br>[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 deploy --targets Localgserv1 gbean-virtualhost1_com.xml  <br>Using GERONIMO_HOME:   /opt/geronimo3 <br>Using GERONIMO_SERVER: /opt/geronimo3/gserv1 <br>Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/var/temp <br>Using JRE_HOME:        /usr/jdk1.6.0/jre <br>    Deployed org.example.configs.virtualhosts/virtualhost1/1.0/car <br>{code} <br> <br>The deployed GBean configuration is an installed module. All modules can be listed, which will show the Virtual Host GBean module just deployed. <br>* For either a single server with no instances, or server with multiple instances: <br>** {{{*}deploy \--user system \--password manager --port &lt;RMI_port&gt; list-modules{*}}} <br> <br>{code:title=Example list-modules} <br>[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 list-modules <br>Using GERONIMO_HOME:   /opt/geronimo3 <br>Using GERONIMO_SERVER: /opt/geronimo3/gserv1 <br>Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/var/temp <br>Using JRE_HOME:        /usr/jdk1.6.0/jre <br>Found 83 modules deployed to 2 targets <br> <br> Target org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car?ServiceModule=org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local <br>  + org.apache.geronimo.configs/activemq-broker-blueprint/3.0-SNAPSHOT/car <br>  ... <br>  + org.example.configs.gserv1/gserv1repo/2.2/car <br>    ... <br>    org.apache.geronimo.plugins.monitoring/agent-car-ejb/3.0-SNAPSHOT/car <br> <br> Target org.example.configs.gserv1/gserv1repo/2.2/car?ServiceModule=org.example.configs.gserv1/gserv1repo/2.2/car,j2eeType=ConfigurationStore,name=Localgserv1 <br>  + org.example.configs.virtualhosts/virtualhost1/1.0/car <br>{code} <br> <br>To remove the configuration, undeploy the GBean <br>* For either a single server with no instances, or server with multiple instances: <br>** {{{*}deploy \--user system \--password manager undeploy org.example.configs.virtualhosts/virtualhost1/1.0/car{*}}} <br> <br>{code:title=Example undeploy} <br>[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 undeploy org.example.configs.virtualhosts/virtualhost1/1.0/car <br>Using GERONIMO_HOME:   /opt/geronimo3 <br>Using GERONIMO_SERVER: /opt/geronimo3/gserv1 <br>Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/var/temp <br>Using JRE_HOME:        /usr/jdk1.6.0/jre <br>    Module org.example.configs.virtualhosts/virtualhost1/1.0/car <br>    unloaded. <br>    Module org.example.configs.virtualhosts/virtualhost1/1.0/car <br>    uninstalled. <br> <br>    Undeployed org.example.configs.virtualhosts/virtualhost1/1.0/car <br>{code} <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h2. Declare the virtual host in the deployment plan <br> <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>
<ul>
    <li><a href='#ConfiguringVirtualHostinTomcat-Manuallyediting%7B%7Bvar%2Fconfig%2Fconfig.xml%7D%7D'>Manually editing <tt>var/config/config.xml</tt></a></li>
    <li><a href='#ConfiguringVirtualHostinTomcat-DeployingaGBeanconfiguration'>Deploying a GBean configuration</a></li>
</ul>
    <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>There are three approaches to defining a virtual host in Geronimo:</p>
<ol>
	<li>Manually by directly editing Geronimo's <tt>var/config/config.xml</tt> to set the definition. Requires a restart of Geronimo.</li>
	<li>Automatically by deploying a GBean which contains the definition. <b>Does not</b> require a restart of Geronimo.</li>
	<li>Manually by editing Tomcat Catalina's <tt>var/catalina/server.xml</tt> to set the definition. Requires a restart of Geronimo.</li>
</ol>


<p>We will cover the first two options which are specific to Geronimo's methodology of configuration. Instructions on performing the third option can be found in documentation on the Apache Tomcat project web site.</p>

<h3><a name="ConfiguringVirtualHostinTomcat-Manuallyediting%7B%7Bvar%2Fconfig%2Fconfig.xml%7D%7D"></a>Manually editing <tt>var/config/config.xml</tt></h3>

<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/tomcat7/3.0/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/tomcat7/3.0/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/tomcat7/3.0/car?ServiceModule=org.apache.geronimo.configs/tomcat7/3.0/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/tomcat7/3.0/car?ServiceModule=org.apache.geronimo.configs/tomcat7/3.0/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/tomcat7/3.0/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-system/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.framework/client-system/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/rmi-naming/3.0-SNAPSHOT/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;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;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/plugin/3.0-SNAPSHOT/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-3.0.txt<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-security/3.0-SNAPSHOT/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/server-security-config/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.framework/shutdown/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.framework/online-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/bundle-recorder/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.framework/geronimo-gbean-deployer/3.0-SNAPSHOT/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/j2ee-server/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/j2ee-deployer/3.0-SNAPSHOT/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.configs/bval-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/transaction-1_6/3.0-SNAPSHOT/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"XidFactory"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"tmId"</span>&gt;</span>${TmId}<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">"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/jasper/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/tomcat7/3.0-SNAPSHOT/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/tomcat7/3.0/car?ServiceModule=org.apache.geronimo.configs/tomcat7/3.0/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/tomcat7/3.0/car?ServiceModule=org.apache.geronimo.configs/tomcat7/3.0/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/tomcat7-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/web-extender/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.framework/offline-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/hot-deployer/3.0-SNAPSHOT/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/remote-deploy-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jasper-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/myfaces/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/myfaces-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/sharedlib-extender/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/sharedlib/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/aries/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/aries-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/persistence-jpa20-deployer/3.0-SNAPSHOT/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 name=<span class="code-quote">"defaultEnvironment"</span> propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span> <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;dependencies&gt;</span>
                        <span class="code-tag">&lt;dependency&gt;</span>
                            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/groupId&gt;</span>
                            <span class="code-tag">&lt;artifactId&gt;</span>openjpa2<span class="code-tag">&lt;/artifactId&gt;</span>
                            <span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
            <span class="code-tag">&lt;/dependency&gt;</span>
          <span class="code-tag">&lt;/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/openjpa2/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/system-database/3.0-SNAPSHOT/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.plugins/pluto-support/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/plugin-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins.monitoring/mconsole-ds/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb/3.0-SNAPSHOT/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;attribute name=<span class="code-quote">"multicastHost"</span>&gt;</span>${MulticastDiscoveryAddress}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multicastPort"</span>&gt;</span>${MulticastDiscoveryPort}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multipointHost"</span>&gt;</span>${MultipointHost}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multipointPort"</span>&gt;</span>${MultipointPort + PortOffset}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multipointServers"</span>&gt;</span>${MultipointServers}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multipointEnabled"</span>&gt;</span>${MultipointEnabled}<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"multicastEnabled"</span>&gt;</span>${MulticastEnabled}<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;gbean name=<span class="code-quote">"DefaultStatefulContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"accessTimeout"</span>&gt;</span>30<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"timeOut"</span>&gt;</span>20<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"capacity"</span>&gt;</span>1000<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"bulkPassivate"</span>&gt;</span>100<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">"DefaultSingletonContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"accessTimeout"</span>&gt;</span>30<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">"DefaultBMPContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"poolSize"</span>&gt;</span>10<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">"DefaultStatelessContainer"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"accessTimeout"</span>&gt;</span>30<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"closeTimeout"</span>&gt;</span>5<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"maxSize"</span>&gt;</span>10<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"minSize"</span>&gt;</span>0<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"strictPooling"</span>&gt;</span>true<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"idleTimeout"</span>&gt;</span>0<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.monitoring/mconsole-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/activemq-broker-blueprint/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/activemq-ra/3.0-SNAPSHOT/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://${ActiveMQHostname}:${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.plugins/activemq-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/debugviews-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/sysdb-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/openejb-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb-deployer/3.0-SNAPSHOT/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>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openejb-corba-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/j2ee-corba-yoko/3.0-SNAPSHOT/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>${ServerHostname}<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>${ServerHostname}<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>${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/openwebbeans/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/openwebbeans-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.framework/jmx-security/3.0-SNAPSHOT/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"JMXSecureConnector"</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>${JMXSecurePort + 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}/JMXSecureConnector<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"algorithm"</span>&gt;</span>Default<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"secureProtocol"</span>&gt;</span>TLS<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"keyStore"</span>&gt;</span>geronimo-default<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"keyAlias"</span>&gt;</span>geronimo<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"trustStore"</span>&gt;</span>geronimo-default<span class="code-tag">&lt;/attribute&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"clientAuth"</span>&gt;</span>false<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.monitoring/agent-ds/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/mejb/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.plugins.monitoring/agent-car-ejb/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins.monitoring/agent-car-jmx/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/welcome-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/javamail/3.0-SNAPSHOT/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}<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/plancreator-console-tomcat/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/client/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/client-security/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/client-corba-yoko/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/client-transaction-1_6/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/client-deployer/3.0-SNAPSHOT/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"AppClientBuilder"</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>${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>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/openejb-client/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/webservices-common/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis-deployer/3.0-SNAPSHOT/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 name=<span class="code-quote">"defaultEnvironment"</span> propertyEditor=<span class="code-quote">"org.apache.geronimo.deployment.service.EnvironmentBuilder"</span>&gt;</span>
                <span class="code-tag">&lt;environment:environment xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span> <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;dependencies&gt;</span>
                        <span class="code-tag">&lt;dependency&gt;</span>
                            <span class="code-tag">&lt;groupId&gt;</span>org.apache.geronimo.configs<span class="code-tag">&lt;/groupId&gt;</span>
                            <span class="code-tag">&lt;artifactId&gt;</span>${webcontainerName}<span class="code-tag">&lt;/artifactId&gt;</span>
                            <span class="code-tag">&lt;type&gt;</span>car<span class="code-tag">&lt;/type&gt;</span>
            <span class="code-tag">&lt;/dependency&gt;</span>
          <span class="code-tag">&lt;/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/jaxws-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/axis2/3.0-SNAPSHOT/car"</span>/&gt;</span>
    &lt;module condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
      (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat7')"
      name=<span class="code-quote">"org.apache.geronimo.configs/axis2-deployer/3.0-SNAPSHOT/car"</span>/&gt;
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jaxws-ejb-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module load=<span class="code-quote">"false"</span> name=<span class="code-quote">"org.apache.geronimo.configs/axis2-ejb/3.0-SNAPSHOT/car"</span>/&gt;</span>
    &lt;module condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
      (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat7')"
      name=<span class="code-quote">"org.apache.geronimo.configs/axis2-ejb-deployer/3.0-SNAPSHOT/car"</span>/&gt;
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jaxws-sun-tools/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/jaxws-tools/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.plugins/uddi-db/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/uddi-tomcat/3.0-SNAPSHOT/car"</span>&gt;</span>
        <span class="code-tag">&lt;gbean name=<span class="code-quote">"DerbyProperties"</span>&gt;</span>
            <span class="code-tag">&lt;attribute name=<span class="code-quote">"systemProperties"</span>&gt;</span>uddi.openjpa.ConnectionURL=jdbc:derby://localhost:${DerbyPort + PortOffset}/UddiDatabase;create=false;<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/wink/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/wink-deployer/3.0-SNAPSHOT/car"</span>/&gt;</span>
    <span class="code-tag">&lt;module name=<span class="code-quote">"org.apache.geronimo.configs/connector-deployer-1_6/3.0-SNAPSHOT/car"</span>/&gt;</span>
<span class="code-tag">&lt;/attributes&gt;</span>
</pre>
</div></div>
<p><b>Note:</b> Some tags in this <tt>config.xml</tt> excerpt shown here are presented in multiple lines for displaying purposes only.</p>


<h3><a name="ConfiguringVirtualHostinTomcat-DeployingaGBeanconfiguration"></a>Deploying a GBean configuration</h3>

<p>First create the GBean. Note the formatting of the <tt>&lt;attribute name="initParams"&gt;</tt> element which must be left as seen.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>gbean-Virtualhost1_com.xml</b></div><div class="codeContent panelContent">
<pre class="code-java">
&lt;module xmlns=<span class="code-quote">"http:<span class="code-comment">//geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;
</span>    &lt;environment&gt;
        &lt;moduleId&gt;
            &lt;groupId&gt;org.example.configs.virtualhosts&lt;/groupId&gt;
            &lt;artifactId&gt;virtualhost1&lt;/artifactId&gt;
            &lt;version&gt;1.0&lt;/version&gt;
            &lt;type&gt;car&lt;/type&gt;
        &lt;/moduleId&gt;
        &lt;dependencies&gt;
            &lt;dependency&gt;
                &lt;groupId&gt;org.apache.geronimo.configs&lt;/groupId&gt;
                &lt;artifactId&gt;tomcat7&lt;/artifactId&gt;
                &lt;type&gt;car&lt;/type&gt;
            &lt;/dependency&gt;
        &lt;/dependencies&gt;
        &lt;hidden-classes/&gt;
        &lt;non-overridable-classes/&gt;
    &lt;/environment&gt;
    &lt;gbean name=<span class="code-quote">"TomcatVirtualHost_1"</span> class=<span class="code-quote">"org.apache.geronimo.tomcat.HostGBean"</span>&gt;
        &lt;attribute name=<span class="code-quote">"className"</span>&gt;org.apache.catalina.core.StandardHost&lt;/attribute&gt;
        &lt;attribute name=<span class="code-quote">"initParams"</span>&gt;name=virtualhost1.com
                                     appBase=
                                     workDir=work&lt;/attribute&gt;
        &lt;reference name=<span class="code-quote">"Engine"</span>&gt;
            &lt;name&gt;TomcatEngine&lt;/name&gt;
        &lt;/reference&gt;
    &lt;/gbean&gt;
&lt;/module&gt;
</pre>
</div></div>

<p>Deploy the GBean to your Geronimo server.</p>
<ul>
	<li>For a single server with no instances:
	<ul>
		<li><tt><b>deploy &#45;-user system &#45;-password manager deploy gbean-Virtualhost1_com.xml</b></tt></li>
	</ul>
	</li>
	<li>For a server with multiple instances:
	<ul>
		<li><tt><b>deploy &#45;-user system &#45;-password manager --port &lt;RMI_port&gt; deploy --targets &lt;instance_repo_target&gt; gbean-Virtualhost1_com.xml</b></tt></li>
	</ul>
	</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example deploy</b></div><div class="codeContent panelContent">
<pre class="code-java">
[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 deploy --targets Localgserv1 gbean-virtualhost1_com.xml 
Using GERONIMO_HOME:   /opt/geronimo3
Using GERONIMO_SERVER: /opt/geronimo3/gserv1
Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/<span class="code-keyword">var</span>/temp
Using JRE_HOME:        /usr/jdk1.6.0/jre
    Deployed org.example.configs.virtualhosts/virtualhost1/1.0/car
</pre>
</div></div>

<p>The deployed GBean configuration is an installed module. All modules can be listed, which will show the Virtual Host GBean module just deployed.</p>
<ul>
	<li>For either a single server with no instances, or server with multiple instances:
	<ul>
		<li><tt><b>deploy &#45;-user system &#45;-password manager --port &lt;RMI_port&gt; list-modules</b></tt></li>
	</ul>
	</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example list-modules</b></div><div class="codeContent panelContent">
<pre class="code-java">
[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 list-modules
Using GERONIMO_HOME:   /opt/geronimo3
Using GERONIMO_SERVER: /opt/geronimo3/gserv1
Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/<span class="code-keyword">var</span>/temp
Using JRE_HOME:        /usr/jdk1.6.0/jre
Found 83 modules deployed to 2 targets

 Target org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car?ServiceModule=org.apache.geronimo.framework/j2ee-system/3.0-SNAPSHOT/car,j2eeType=ConfigurationStore,name=Local
  + org.apache.geronimo.configs/activemq-broker-blueprint/3.0-SNAPSHOT/car
  ...
  + org.example.configs.gserv1/gserv1repo/2.2/car
    ...
    org.apache.geronimo.plugins.monitoring/agent-car-ejb/3.0-SNAPSHOT/car

 Target org.example.configs.gserv1/gserv1repo/2.2/car?ServiceModule=org.example.configs.gserv1/gserv1repo/2.2/car,j2eeType=ConfigurationStore,name=Localgserv1
  + org.example.configs.virtualhosts/virtualhost1/1.0/car
</pre>
</div></div>

<p>To remove the configuration, undeploy the GBean</p>
<ul>
	<li>For either a single server with no instances, or server with multiple instances:
	<ul>
		<li><tt><b>deploy &#45;-user system &#45;-password manager undeploy org.example.configs.virtualhosts/virtualhost1/1.0/car</b></tt></li>
	</ul>
	</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example undeploy</b></div><div class="codeContent panelContent">
<pre class="code-java">
[root@server geronimo3]# env GERONIMO_SERVER=gserv1 bin/deploy --user system --password manager --port 1199 undeploy org.example.configs.virtualhosts/virtualhost1/1.0/car
Using GERONIMO_HOME:   /opt/geronimo3
Using GERONIMO_SERVER: /opt/geronimo3/gserv1
Using GERONIMO_TMPDIR: /opt/geronimo3/gserv1/<span class="code-keyword">var</span>/temp
Using JRE_HOME:        /usr/jdk1.6.0/jre
    Module org.example.configs.virtualhosts/virtualhost1/1.0/car
    unloaded.
    Module org.example.configs.virtualhosts/virtualhost1/1.0/car
    uninstalled.

    Undeployed org.example.configs.virtualhosts/virtualhost1/1.0/car
</pre>
</div></div>


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

<p>For this topic, 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 is used as an example. Because this is a Web application, the deployment plan that you need to modify is a <tt>geronimo-web.xml</tt> file. If you use a different type of application, you might need to modify a different deployment plan, for example <tt>geronimo-application.xml</tt>.</p>

<p>In the previous section, you defined two Virtual Hosts. Now, you can configure two applications so that they can be deployed to those Virtual Hosts exclusively.</p>

<p>The following section uses the same application for the two Virtual Hosts, but will differentiate one deployment from the other by giving it a different <b>artifactId</b>. This way you can identify each deployment without modifying the code.</p>

<p>If 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, your HelloWorld application 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 that you 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>
&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"</span>
         <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming-1.2"</span>
         <span class="code-keyword">xmlns:sec</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security-2.0"</span>
         <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;

  <span class="code-tag">&lt;sys:environment&gt;</span>
    <span class="code-tag">&lt;sys:moduleId&gt;</span>
      <span class="code-tag">&lt;sys:groupId&gt;</span>sample.applications<span class="code-tag">&lt;/sys:groupId&gt;</span>
      <span class="code-tag">&lt;sys:artifactId&gt;</span>HelloWorldApp_1<span class="code-tag">&lt;/sys:artifactId&gt;</span>
      <span class="code-tag">&lt;sys:version&gt;</span>2.2<span class="code-tag">&lt;/sys:version&gt;</span>
      <span class="code-tag">&lt;sys:type&gt;</span>war<span class="code-tag">&lt;/sys:type&gt;</span>
    <span class="code-tag">&lt;/sys:moduleId&gt;</span>
    <span class="code-tag">&lt;sys:dependencies/&gt;</span>
    <span class="code-tag">&lt;sys:hidden-classes/&gt;</span>
    <span class="code-tag">&lt;sys:non-overridable-classes/&gt;</span>
  <span class="code-tag">&lt;/sys: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>When the HelloWorld application is deployed, this application should only be listed in the host with the name <b>virtualhost1.com</b>.</p>

<p>Now repeat the steps to create a second WAR. Edit the <tt>geronimo-web.xml</tt> file once again and copy the content from 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">
&lt;web-app xmlns=<span class="code-quote">"http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"</span>
         <span class="code-keyword">xmlns:naming</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/naming-1.2"</span>
         <span class="code-keyword">xmlns:sec</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/security-2.0"</span>
         <span class="code-keyword">xmlns:sys</span>=<span class="code-quote">"http://geronimo.apache.org/xml/ns/deployment-1.2"</span>&gt;

  <span class="code-tag">&lt;sys:environment&gt;</span>
    <span class="code-tag">&lt;sys:moduleId&gt;</span>
      <span class="code-tag">&lt;sys:groupId&gt;</span>sample.applications<span class="code-tag">&lt;/sys:groupId&gt;</span>
      <span class="code-tag">&lt;sys:artifactId&gt;</span>HelloWorldApp_2<span class="code-tag">&lt;/sys:artifactId&gt;</span>
      <span class="code-tag">&lt;sys:version&gt;</span>2.2<span class="code-tag">&lt;/sys:version&gt;</span>
      <span class="code-tag">&lt;sys:type&gt;</span>war<span class="code-tag">&lt;/sys:type&gt;</span>
    <span class="code-tag">&lt;/sys:moduleId&gt;</span>
    <span class="code-tag">&lt;sys:dependencies/&gt;</span>
    <span class="code-tag">&lt;sys:hidden-classes/&gt;</span>
    <span class="code-tag">&lt;sys:non-overridable-classes/&gt;</span>
  <span class="code-tag">&lt;/sys: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 changes 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><b><tt>jar &#45;cvf HelloWorld_2.war &#42;</tt></b></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 which 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 the following 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-tomcat7-javaee6-3.0-SNAPSHOT\bin&gt;deploy --user system --password manager deploy \HelloWorld_2.2\HelloWorld_1.war
Using GERONIMO_HOME:   D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT
Using GERONIMO_SERVER: D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT
Using GERONIMO_TMPDIR: D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT\var\temp
Using JRE_HOME:        C:\Java\jdk1.6.0\jre
    Deployed sample.applications/HelloWorldApp_1/2.2/war @ /hello_1
</pre>
</div></div></font></p>

<p>Repeat the deployment process 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 the following 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-tomcat7-javaee6-3.0-SNAPSHOT\bin&gt;deploy --user system --password manager deploy \HelloWorld_2.2\HelloWorld_2.war
Using GERONIMO_HOME:   D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT
Using GERONIMO_SERVER: D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT
Using GERONIMO_TMPDIR: D:\geronimo-tomcat7-javaee6-3.0-SNAPSHOT\var\temp
Using JRE_HOME:        C:\Java\jdk1.6.0\jre
    Deployed sample.applications/HelloWorldApp_2/2.2/war @ /hello_2
</pre>
</div></div></font></p>

<p>With the applications deployed, you can now test them. To test the first application that has the context-root <b>hello_1</b>, access the host names defined on the Geronimo server machine with the URLs in the following table:</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 the second application that has the context-root <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=9&originalVersion=8">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