0 Replies Latest reply on Apr 28, 2008 4:35 PM by pasc_dev

    how can we configure virtualhost for Jboss 4.2.0 and jboss p

    pasc_dev

      Hello,

      we have deployed one ear application on jboss portal. This ear contains only one war.
      On jboss portal, we have created two portal instances : jbpInstance1 and jbpInstance2.

      Now, i have only one domaine : www.myDomain.com. So i can connect to each portal instance like that :

      www.myDomain.com/portal/jbpInstance1
      www.myDomain.com/portal/jbpInstance2

      The aim is to define two virtualhosts, one for each portal instance like that

      www.virtalhost1.com => www.myDomain.com/portal/jbpInstance1
      www.virtalhost2.com => www.myDomain.com/portal/jbpInstance2

      so, in jboss portal => server => default => deploy => jboss-web.deployer
      i have modified the server.xml file :

      1- configure on the port 80
      2- define virtualhosts :

      <Host name="mydomain.com"
      autoDeploy="false" deployOnStartup="false" deployXML="false">
      <Alias>www.mydomain.com</Alias>
      
      <Valve className="org.apache.catalina.valves.AccessLogValve"
      prefix="mydomain.com" suffix=".log" pattern="common"
      directory="${jboss.server.home.dir}/log"/>
      
      <DefaultContext cookies="true" crossContext="true" override="true"/>
      </Host>
      


      In the application.xml packaged in a EAR, i define the context :
      <web-uri>mywebapp.war</web-uri>
      <context-root>/</context-root>
      


      and, in the only war file in the ear, i add lines like the example below in mywebapp.war WEB-INF/jboss-web.xml file :
      <jboss-web>
      <!-- Root Contest for virtual Host --->
      <context-root>/</context-root>
      <virtual-host>mydomain.com</virtual-host>
      </jboss-web>
      


      So, how can i define two virtualhosts with only one war in the ear ?


      Thanks you for your anwers :)