Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

AnchortoptopThis 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.

To configure a virtual host in Geronimo you basically need to:

...

Table of Contents

This article used the simple HelloWorld application as a reference, this application is covered in the Quick start - Apache Geronimo for the impatient section.

...

Make sure your system can resolve these names.

Define Virtual host

...

titleBe Careful

...

Now you need to define those virtual hosts in Geronimo's config.xml so it can recognize them. This section provides two different virtual hosts definitions, that is creating two new HostGBean (TomcatVirtualHost1 and TomcatVirtualHost2) in the Geronimo configuration, one of those will have multiple host names aliases. The goal of this example is to have an application listening on a single virtual host ( this will be virtualhost1.com ) and another application listening on a different virtual host ( this will be virtualhost2.com ) with two additional aliases ( this will be virtualhost3.com and virtualhost4.com ).

...

At this point you have successfully configured two different virtual hosts in Geronimo. Make sure you save the changes to the config.xml file and start*\ Geronimo.Back to Top

For additional reference, this is an excerpt from config.xml of the entire <module name="org.apache.geronimo.configs/tomcat6/2.1/car"> entry with the two HostGBean already defined.

Code Block
xml
xml
borderStylesolid
titleconfig.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- $Rev: 562176 $ $Date: 2007-08-02 12:31:43 -0400 (Thu, 02 Aug 2007) $ -->

<!-- ======================================================== -->
<!-- Warning - This XML file is re-generated by Geronimo when -->
<!-- changes are made to Geronimo's configuration, therefore  -->
<!-- any comments added to this file will be lost.            -->
<!-- ======================================================== -->

<attributes xmlns="http://geronimo.apache.org/xml/ns/attributes-1.1">

<attributes xmlns:ns2="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns="http://geronimo.apache.org/xml/ns/attributes-1.2">
    <comment>
==================================================================
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 !!!!
==================================================================</comment>
    <module name="org.apache.geronimo.framework/j2ee-security/2.1/car">
        <gbean name="JMXService">
            <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${JMXPort + PortOffset}</attribute>
            <attribute name="urlPath">/jndi/rmi://${ServerHostname}:${NamingPort + PortOffset}/JMXConnector</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.framework/rmi-naming/2.1/car">
        <gbean name="RMIRegistry">
            <attribute name="port">${NamingPort + PortOffset}</attribute>
        </gbean>
        <gbean name="NamingProperties">
            <attribute name="namingProviderUrl">rmi://${ServerHostname}:${NamingPort + PortOffset}</attribute>
        </gbean>
        <gbean name="DefaultThreadPool">
            <attribute name="keepAliveTime">30000</attribute>
            <attribute name="minPoolSize">${MinThreadPoolSize}</attribute>
            <attribute name="maxPoolSize">${MaxThreadPoolSize}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.framework/j2ee-system/2.1/car"/>
    <module name="org.apache.geronimo.framework/jee-specs/2.1/car"/>
    <module name="org.apache.geronimo.framework/shutdown/2.1/car" load="false"/>
    <module name="org.apache.geronimo.framework/client-system/2.1/car" load="false"/>
    <module name="org.apache.geronimo.framework/online-deployer/2.1/car" load="false"/>
    <module name="org.apache.geronimo.framework/transformer-agent/2.1/car"/>
    <module name="org.apache.geronimo.framework/server-security-config/2.1/car"/>
    <module name="org.apache.geronimo.framework/plugin/2.1/car">
        <gbean name="DownloadedPluginRepos">
            <attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.1.txt</attribute>
            <attribute name="userRepositories">~/.m2/repository</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.framework/xmlbeans/2.1/car"/>
    <module name="org.apache.geronimo.configs/myfaces-deployer/2.1/car"/>
    <module name="org.apache.geronimo.configs/myfaces/2.1/car"/>
    <module name="org.apache.geronimo.configs/j2ee-server/2.1/car"/>
    <module name="org.apache.geronimo.configs/j2ee-deployer/2.1/car">
        <gbean name="WebBuilder">
            <attribute name="defaultNamespace">http://geronimo.apache.org/xml/ns/j2ee/web/jetty-2.0</attribute>
        </gbean>
        <gbean name="EnvironmentEntryBuilder">
            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.framework/geronimo-gbean-deployer/2.1/car">
        <gbean name="Deployer">
            <attribute name="remoteDeployAddress">http://${RemoteDeployHostname}:${HTTPPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/activemq-ra/2.1/car">
        <gbean name="ActiveMQ RA">
            <attribute name="ServerUrl">tcp://${ServerHostname}:${ActiveMQPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/activemq-broker/2.1/car">
        <gbean name="ActiveMQ.tcp.default">
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${ActiveMQPort + PortOffset}</attribute>
        </gbean>
        <gbean name="ActiveMQ.stomp.default">
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${ActiveMQStompPort + PortOffset}</attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/rmisystem-namingdatabase/2.01/car">
        <gbean name="RMIRegistryDerbyNetwork">
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${NamingPortDerbyPort + PortOffset}</attribute>
        </gbean>
    </module>
    <gbean<module name="NamingProperties">
      org.apache.geronimo.configs/transaction/2.1/car">
      <!-- Check whether this really works if host name is 0.0.0.0 --<gbean name="ResourceBindings">
            <attribute name="namingProviderUrl">rmi://${ServerHostname}:${NamingPort + PortOffsetformat">${ResourceBindingsFormat}</attribute>
        </gbean>
        <gbean<attribute name="DownloadedPluginRepos">
nameInNamespace">${ResourceBindingsNameInNamespace}</attribute>
            <attribute name="repositoryList">http://geronimo.apache.org/plugins/plugin-repository-list-2.1.txt<namePattern">${ResourceBindingsNamePattern}</attribute>
            <attribute name="userRepositories">[]abstractNameQuery">${ResourceBindingsQuery}</attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/j2eeuddi-servertomcat/2.1/car"/>

    <module name="org.apache.geronimo.configs/transactionaxis/2.1/car"/>

    <module name="org.apache.geronimo.configs/j2eewebservices-securitycommon/2.1/car"/>
    <module    <gbean name="JMXServiceorg.apache.geronimo.configs/openejb/2.1/car">
         <gbean   <attribute name="protocol">rmi</attribute>
            <attribute name="host">${ServerHostname}</attribute>EJBNetworkService">
            <attribute name="port">${JMXPortOpenEJBPort + PortOffset}</attribute>
            <attribute name="urlPath">/jndi/rmi://$host">${ServerHostname}:${NamingPort + PortOffset}/JMXConnector<</attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/axisopenjpa/2.1/car" load="false"/>
    <module name="org.apache.geronimo.configs/axis2jasper/2.1/car" load="false"/>
    <module name="org.apache.geronimo.configs/cxftomcat6/2.1/car" load="false"/>

>

        <!-- Virtual Host 1 definition -->
        <module<gbean name="org.apache.geronimo.configs/openejbtomcat6/2.1/car">
        <gbean name="EJBNetworkService">?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,
            <attribute name="port">${OpenEJBPort + PortOffset}</attribute>j2eeType=Host,name=TomcatVirtualHost_1" gbeanInfo="org.apache.geronimo.tomcat.HostGBean">
            <attribute name="host">${ServerHostname}<className">org.apache.catalina.core.StandardHost</attribute>
        </gbean>
    </module>

    <module<attribute name="initParams"org.apache.geronimo.configs/j2ee-corba-yoko/2.1/car" load="false">
>name=virtualhost1.com
			            <gbean name="NameServer">
    appBase=
        <attribute name="port">${COSNamingPort + PortOffset}</attribute>
            <attribute name="host">${COSNamingHost}</attribute>
        </gbean>
        <gbean name="Server">workDir=work</attribute>
        </gbean>

    <attribute name="port">${ORBSSLPort + PortOffset}</attribute>
        <!-- Virtual Host 2 and aliases definition -->
        <attribute<gbean name="host">${ORBSSLHost}</attribute>org.apache.geronimo.configs/tomcat6/2.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,
        </gbean> j2eeType=Host,name=TomcatVirtualHost_2" gbeanInfo="org.apache.geronimo.tomcat.HostGBean">
        <gbean    <attribute name="UnprotectedServer">className">org.apache.catalina.core.StandardHost</attribute>
            <attribute name="port">${ORBPort + PortOffset}</attribute>
initParams">name=virtualhost2.com
			                <attribute name="host">${ORBHost}</attribute>
appBase=
         </gbean>
     </module>

    <module name="org.apache.geronimo.configs/system-database/2.1/car">
        <gbean name="DerbyNetwork">
            <attribute name="host">${ServerHostname}<workDir=work</attribute>
            <attribute name="port">${DerbyPort + PortOffset}<aliases">virtualhost3.com,virtualhost4.com</attribute>
        </gbean>


    </module>

     <module<gbean name="org.apache.geronimo.configs/activemq-broker/2.1/carTomcatWebConnector">
           <gbean <attribute name="ActiveMQ.tcp.default">host">${ServerHostname}</attribute>
            <attribute name="hostport">${ServerHostnameHTTPPort + PortOffset}</attribute>
            <attribute name="portredirectPort">${ActiveMQPortHTTPSPort + PortOffset}</attribute>
          </gbean>  <attribute name="maxHttpHeaderSize">8192</attribute>
        <gbean    <attribute name="ActiveMQ.stomp.default">maxThreads">150</attribute>
            <attribute name="host">${ServerHostname}<minSpareThreads">25</attribute>
            <attribute name="port">${ActiveMQStompPort + PortOffset}<maxSpareThreads">75</attribute>
         </gbean>
    </module>
<attribute name="enableLookups">false</attribute>
    <module name="org.apache.geronimo.configs/activemq-ra/2.1/car">
        <gbean<attribute name="ActiveMQ RA">acceptCount">100</attribute>
            <attribute name="ServerUrl">tcp://${ServerHostname}:${ActiveMQPort + PortOffsetconnectionTimeout">${WebConnectorConTimeout}</attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/jasper/2.1/car" load="false"/>
<attribute name="disableUploadTimeout">true</attribute>
        </gbean>
    <module    <gbean name="org.apache.geronimo.configs/myfaces/2.1/car"/>

TomcatAJPConnector">
            <module<attribute name="org.apache.geronimo.configs/tomcat6/2.1/car">
"host">${ServerHostname}</attribute>
            <gbean<attribute gbeanInfoname="org.apache.geronimo.tomcat.HostGBean"port">${AJPPort + PortOffset}</attribute>
            <attribute name="redirectPort">${HTTPSPort + PortOffset}</attribute>
            <attribute name="org.apache.geronimo.configs/tomcat6/2.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,minSpareThreads">25</attribute>
            <attribute name="maxSpareThreads">75</attribute>
            <attribute j2eeType=Host,name=TomcatVirtualHost_1">"enableLookups">false</attribute>
        </gbean>
    <attribute    <gbean name="className">org.apache.catalina.core.StandardHost</attribute>
   TomcatWebSSLConnector">
             <attribute name="initParams">name=virtualhost1.comhost">${ServerHostname}</attribute>
            <attribute name="port">${HTTPSPort + PortOffset}</attribute>
            <attribute name="maxHttpHeaderSize">8192</attribute>
            <attribute     appBase=name="maxThreads">150</attribute>
            <attribute name="minSpareThreads">25</attribute>
            <attribute name="maxSpareThreads">75</attribute>
                   workDir=work<attribute name="enableLookups">false</attribute>
                <<attribute name="acceptCount">100</attribute>
        </gbean>
        <gbean gbeanInfo="org.apache.geronimo.tomcat.HostGBean"<attribute name="disableUploadTimeout">false</attribute>
            <attribute name="clientAuth">false</attribute>
            <attribute name="org.apache.geronimo.configs/tomcat6/2.1/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1/car,"algorithm">Default</attribute>
            <attribute name="sslProtocol">TLS</attribute>
            <attribute j2eeType=Host,name=TomcatVirtualHost_2">name="keystoreFile">var/security/keystores/geronimo-default</attribute>
            <attribute name="className">org.apache.catalina.core.StandardHost<keystorePass">secret</attribute>
                <attribute name="initParams">name=virtualhost2.comkeystoreType">JKS</attribute>
        </gbean>
        <gbean name="TomcatHost">
            <attribute name="initParams">name=${ServerHostname}
               appBase=
                              appBase=
               workDir=work
                </attribute>
                <attribute name="aliases">virtualhost3.com,virtualhost4.com<workDir=work</attribute>
        </gbean>
        <!-- To disable accesslogging uncomment the following lines   </module>
    <module name="org.apache.geronimo.configs/connector-deployer/2.1/car">
        <gbean name="TomcatEngineResourceRefBuilder">
            <reference<attribute name="TomcatValveChain" />
 eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
       </gbean>
     <attribute   <gbean name="FirstValve" load="false"></gbean>propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder" name="corbaEnvironment">
        -->
        <gbean name="TomcatResources"/>
<environment:environment xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
          <gbean name="TomcatWebConnector">
         <environment:dependencies>
   <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${HTTPPortPrimary + PortOffset}</attribute>
     <environment:dependency>
       <attribute name="redirectPort">${HTTPSPortPrimary + PortOffset}</attribute>
        </gbean>
         <gbean name="TomcatAJPConnector"> <environment:groupId>org.apache.geronimo.configs</environment:groupId>
            <attribute name="host">${ServerHostname}</attribute>
            <attribute name="port">${AJPPortPrimary + PortOffset}</attribute>
 <environment:artifactId>j2ee-corba-yoko</environment:artifactId>
                 <attribute name="redirectPort">${HTTPSPortPrimary + PortOffset}</attribute>
        </gbean><environment:type>car</environment:type>
        <gbean name="TomcatWebSSLConnector">
   </environment:dependency>
         <attribute name="host">${ServerHostname}</attribute>environment:dependencies>
        </environment:environment></attribute>
     <attribute name="port">${HTTPSPortPrimary + PortOffset}</attribute>gbean>
        </gbean>
 <gbean name="AdminObjectRefBuilder">
     </module>

    <!--
    NOTE: n.b. be sure the gbean deployer is explicitly loaded before j2ee-deployer<attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
          so that defaultEnvironment overrides work properly
<gbean name="ClientResourceRefBuilder">
        -->
    <module<attribute name="org.apache.geronimo.configs/geronimo-gbean-deployer/2.1/car"/>

    <module name="org.apache.geronimo.configs/j2ee-deployer/2.1/car">
"eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
             <gbean<attribute propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder" name="WebBuildercorbaEnvironment">
               <attribute name="defaultNamespace">http <environment:environment xmlns:environment="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0</attribute>
 deployment-1.2">
       </gbean>
        <gbean name="EnvironmentEntryBuilder">
    <environment:dependencies>
        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            </gbean>
    </module>

<environment:dependency>
     <module name="org.apache.geronimo.configs/connector-deployer/2.1/car">
        <gbean name="ResourceRefBuilder">
            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute> <environment:groupId>org.apache.geronimo.configs</environment:groupId>
            <attribute name="defaultEnvironment">
                  <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
:artifactId>client-corba-yoko</environment:artifactId>
                           <dependencies>
 <environment:type>car</environment:type>
            </environment:dependency>
          </environment:dependencies>
    <dependency>
    </environment:environment></attribute>
        </gbean>
    </module>
    <module name="org.apache.geronimo.configs/axis2/2.1/car"/>
       <groupId>org<module name="org.apache.geronimo.configs</groupId>.configs/jasper-deployer/2.1/car"/>
    <module name="org.apache.geronimo.configs/remote-deploy-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.configs/client-security/2.1/car" load="false"/>
          <module name="org.apache.geronimo.configs/client/2.1/car" load="false"/>
       <artifactId>j2ee-corba-yoko</artifactId>
              <module name="org.apache.geronimo.configs/axis2-ejb-deployer/2.1/car" condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat6')">
              <type>car</type><gbean name="Axis2ModuleBuilderExtension">
            <attribute name="listener">?name=${webcontainer}</attribute>
           </dependency>gbean>
    </module>
    <module name="org.apache.geronimo.configs/jaxws-ejb-deployer/2.1/car"/>
    <module name="org.apache.geronimo.configs/jaxws-deployer/2.1/car"/>
      </dependencies><module name="org.apache.geronimo.configs/openejb-deployer/2.1/car">
        <gbean name="EjbRefBuilder">
       </environment>
            <<attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>

        <gbean name="AdminObjectRefBuilderClientEjbRefBuilder">
            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute name="host">${ServerHostname}</gbean>

attribute>
            <gbean<attribute name="ClientResourceRefBuilder">
port">${OpenEJBPort + PortOffset}</attribute>
        </gbean>
    </module>
    <attribute<module name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
            <attribute name="defaultEnvironment">
                <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"org.apache.geronimo.configs/axis2-deployer/2.1/car" condition="props['org.apache.geronimo.jaxws.provider'] == 'axis2' or 
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'tomcat6')"/>
    <module name="org.apache.geronimo.configs/axis2-ejb/2.1/car"/>
                    <dependencies>
             <module name="org.apache.geronimo.configs/ca-helper-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.plugins/agent/2.1/car"/>
      <dependency><module name="org.apache.geronimo.plugins/agent-ds/2.1/car"/>
    <module name="org.apache.geronimo.configs/mejb/2.1/car"/>
        <module name="org.apache.geronimo.configs/tomcat6-clustering-builder-wadi/2.1/car">
        <gbean name="TomcatClusteringBuilder">
      <groupId>org.apache.geronimo.configs</groupId>
      <attribute name="defaultSweepInterval">${DefaultWadiSweepInterval}</attribute>
            <attribute name="defaultNumPartitions">${DefaultWadiNumPartitions}</attribute>
        <artifactId>client-corba-yoko</artifactId></gbean>
    </module>
    <module name="org.apache.geronimo.configs/tomcat6-deployer/2.1/car"/>
        <module name="org.apache.geronimo.configs/tomcat6-clustering-wadi/2.1/car" load="false"/>
    <module       <type>car</type>name="org.apache.geronimo.configs/wadi-clustering/2.1/car" load="false">
        <gbean name="DefaultBackingStrategyFactory">
               <attribute name="nbReplica">${ReplicaCount}</dependency>attribute>
        </gbean>
            </dependencies><gbean name="DefaultDispatcherHolder">
                <attribute name="endPointURI">${EndPointURI}</environment>attribute>
            <attribute name="clusterName">${ClusterName}</attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/persistence-jpa10-deployerclustering/2.01/car">
        <gbean name="PersistenceUnitBuilderNode">
            <attribute name="defaultPersistenceProviderClassName">org"nodeName">${clusterNodeName}</attribute>
        </gbean>
    </module>
    <module name="org.apache.openjpa.persistence.PersistenceProviderImpl</attribute>geronimo.plugins/debugviews-console-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.plugins/console-tomcat/2.1/car"/>
    <module   <attribute name="defaultPersistenceUnitProperties"org.apache.geronimo.plugins/pluto-support/2.1/car"/>
                openjpa.Log=commons<module name="org.apache.geronimo.configs/spring/2.1/car"/>
            #   openjpa.jdbc.DBDictionary=<module name="org.apache.openjpa.jdbc.sql.DerbyDictionary
  geronimo.configs/dojo-legacy-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.configs/persistence-jpa10-deployer/2.1/car">
        <gbean openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)name="PersistenceUnitBuilder">
                <attribute name="defaultPersistenceProviderClassName">org.apache.openjpa.jdbc.UpdateManager=operation-orderpersistence.PersistenceProviderImpl</attribute>
                openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)<attribute name="defaultPersistenceUnitProperties">openjpa.Log=commons
            </attribute>
            <attribute name="defaultEnvironment">
                <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
 openjpa.jdbc.SynchronizeMappings=buildSchema(ForeignKeys=true)
                         <dependencies>
               openjpa.jdbc.UpdateManager=operation-order
         <dependency>
                            <groupId>org.apache.geronimo.configs</groupId>
   openjpa.Sequence=table(Table=OPENJPASEQ, Increment=100)</attribute>
            <attribute propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder" name="defaultEnvironment">
          <artifactId>openjpa</artifactId>
      <environment:environment xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
                     <type>car</type><environment:dependencies>
                        </<environment:dependency>
                    </dependencies>
                </environment><environment:groupId>org.apache.geronimo.configs</environment:groupId>
            </attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/openejb-deployer/2.1/car">
   <environment:artifactId>openjpa</environment:artifactId>
      <gbean name="EjbRefBuilder">
            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</attribute>
        </gbean>
<environment:type>car</environment:type>
        <gbean name="ClientEjbRefBuilder">
   </environment:dependency>
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee< </environment:dependencies>
        </environment:environment></attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configsplugins/clientplugin-console-deployertomcat/2.1/car"/>
     </module>
<module name="org.apache.geronimo.plugins/plancreator-console-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.configsframework/axis2upgrade-deployercli/2.1/car" load="false"/>
            condition="props.getProperty('<module name="org.apache.geronimo.jaxws.provider', 'axis2') == 'axis2'configs/axis-deployer/2.1/car">

        <gbean name="Axis2ModuleBuilderExtensionAxisModuleBuilderExtension">
            <attribute name="listener">?name=TomcatWebContainer<${webcontainer}</attribute>
            <attribute propertyEditor="org.apache.geronimo.deployment.service.EnvironmentBuilder" name="defaultEnvironment">
                <environment:environment xmlns:environment="http://geronimo.apache.org/xml/ns/deployment-1.2">
              <dependencies>
                  <dependency>
         >
             <groupId>org.apache.geronimo.configs</groupId>
       <environment:dependencies>
               <artifactId>tomcat6</artifactId>
         <environment:dependency>
             <type>car</type>
               <environment:groupId>org.apache.geronimo.configs</environment:groupId>
   </dependency>
              </dependencies>
            <environment:artifactId>${webcontainerName}</environment>environment:artifactId>
            </attribute>
       </gbean>
    </module>

    <module name="org.apache.geronimo.configs/cxf-deployer/2.1/car" <environment:type>car</environment:type>
            condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf'">

</environment:dependency>
         <gbean name="CXFModuleBuilderExtension"> </environment:dependencies>
         </environment:environment></attribute>
   <attribute name="listener">?name=TomcatWebContainer</attribute>
    </gbean>
    </module>
    <attribute<module name="defaultEnvironment">
     org.apache.geronimo.configs/j2ee-corba-yoko/2.1/car">
        <gbean <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2name="NameServer">
            <attribute name="port">${COSNamingPort +  <dependencies>
PortOffset}</attribute>
            <attribute name="host">${COSNamingHost}</attribute>
        <dependency></gbean>
        <gbean name="Server">
            <attribute name="port">${ORBSSLPort  <groupId>org.apache.geronimo.configs</groupId>
+ PortOffset}</attribute>
            <attribute name="host">${ORBSSLHost}</attribute>
             <artifactId>tomcat6</artifactId></gbean>
        <gbean name="UnprotectedServer">
            <attribute name="port">${ORBPort + <type>car<PortOffset}</type>attribute>
            <attribute name="host">${ORBHost}</attribute>
        </dependency>gbean>
    </module>
    <module name="org.apache.geronimo.configs/hot-deployer/2.1/car">
         </dependencies><gbean name="HotDeployer">
              <attribute name="path">deploy/</environment>attribute>
             <<attribute name="pollIntervalMillis">2000</attribute>
        </gbean>
    </module>

    <module name="org.apache.geronimo.configs/axis-deployerfarming/2.1/car" load="false">
        <gbean name="AxisServiceRefBuilderNodeInfo">
            <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee,http://java.sun.com/xml/ns/javaee</name">${clusterNodeName}</attribute>
        </gbean>
        <gbean name="ClusterInfo">
            <attribute name="name">${clusterName}</attribute>
        </gbean>
    </module>
    <gbean<module name="AxisModuleBuilderExtension"org.apache.geronimo.plugins/sysdb-console-tomcat/2.1/car"/>
            <attribute <module name="listener">?name=TomcatWebContainer</attribute>org.apache.geronimo.framework/offline-deployer/2.1/car" load="false"/>
            <attribute name="defaultEnvironment"<module name="org.apache.geronimo.configs/openejb-corba-deployer/2.1/car"/>
              <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2">
                <dependencies>
                    <dependency>
                        <groupId>org.apache.geronimo.configs</groupId><module name="org.apache.geronimo.plugins/activemq-console-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.configs/client-corba-yoko/2.1/car" load="false"/>
                        <artifactId>tomcat6</artifactId><module name="org.apache.geronimo.configs/javamail/2.1/car">
                        <type>car</type><gbean name="SMTPTransport">
                    </dependency><attribute name="host">${SMTPHost}</attribute>
            <attribute name="port">${SMTPPort +  PortOffset}</dependencies>attribute>
        </gbean>
      </environment>module>
    <module name="org.apache.geronimo.configs/cxf-deployer/2.1/car" condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf'   or </attribute>
        </gbean>
    </module>
(props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'jetty6')"/>
    <module name="org.apache.geronimo.configs/javamailcxf/2.1/car"/>
    <module    <gbean name="SMTPTransport">
            <attribute name="host">localhost</attribute>
            <attribute name="port">25</attribute>
        </gbean>
    </module>
name="org.apache.geronimo.configs/welcome-tomcat/2.1/car"/>
    <module name="org.apache.geronimo.configs/sharedlib/2.1/car"/>
    <module    <gbean name="SharedLib"org.apache.geronimo.plugins/mconsole-tomcat/2.1/car"/>
            <attribute<module name="classesDirs">var/shared/classes</attribute>org.apache.geronimo.plugins/mconsole-ds/2.1/car"/>
            <attribute <module name="libDirs">var/shared/lib</attribute>
        </gbean>
    </module>

org.apache.geronimo.configs/client-deployer/2.1/car"/>
    <module name="org.apache.geronimo.configs/client-transaction/2.1/car" load="false"/>
    <module name="org.apache.geronimo.configs/tomcat6cxf-ejb-deployer/2.1/car"/>

car" condition="props['org.apache.geronimo.jaxws.provider'] == 'cxf' or 
    (props['org.apache.geronimo.jaxws.provider'] == null and webcontainerName == 'jetty6')">
        <module<gbean name="org.apache.geronimo.configs/jasper-deployer/2.1/car"/>

CXFModuleBuilderExtension">
            <module<attribute name="org.apache.geronimo.configs/myfaces-deployer/2.1/car"/>

listener">?name=${webcontainer}</attribute>
       <module name="org.apache.geronimo.configs/welcome-tomcat/2.1/car"/>
 </gbean>
    </module>
    <module name="org.apache.geronimo.configs/dojocxf-tomcatejb/2.1/car"/>

    <module name="org.apache.geronimo.configs/webconsoledojo-tomcat/2.1/car"/>

    <module name="org.apache.geronimo.configs/uddijsr88-ear-tomcatconfigurer/2.1/car" load="false"/>

    <module name="org.apache.geronimo.configs/remotejsr88-deployjar-tomcatconfigurer/2.1/car" />

    <module name="org.apache.geronimo.configs/hot-deployer/2.1/carload="false"/>

    <module name="org.apache.geronimo.configs/jsr88-rarwar-configurer/2.1/car" load="false"/>

    <module name="org.apache.geronimo.configsframework/cajsr88-helper-tomcatdeploymentfactory/2.1/car" load="false"/>

</attributes>

Note: Some tags in the config.xml shown above are presented in multiple lines for displaying purposes only.Back to Top

Declare the virtual host in the deployment plan

...

You now have two applications ready to be deployed to two different virtual hosts.

Back to Top

Deploy the application

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 <geronimo_home>\bin directory:

...

Congratulations!!! you have successfully configured and deployed two applications to two different virtual hosts and aliases.Back to Top