3 Replies Latest reply on Sep 29, 2011 8:18 AM by Peter Riisager

    VirtualHosts with JBoss 4.2.3.GA

    Romain Cherchi Newbie

      Hi guys,


      I know it may not be the right place to ask this but I can't figure out how to set up virtual hosts with JBoss 4.2.3.GA (JBossWeb) and Seam 2.1.1.GA.


      Here is their application.xml file :


      - myproject1


      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://java.sun.com/xml/ns/javaee" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
                   version="5">
          
         <display-name>myproject1</display-name>
         
         <module>
            <web>
               <web-uri>myproject1.war</web-uri>
               <context-root>/myproject1</context-root>
            </web>
         </module>
         
         <module>
            <ejb>myproject1.jar</ejb>
         </module>
         
         <!-- Seam and EL -->
         <module>
             <ejb>jboss-seam.jar</ejb>
         </module>
         
      </application>
      




      - myproject2


      
      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns="http://java.sun.com/xml/ns/javaee" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
                   version="5">
          
         <display-name>myproject2</display-name>
         
         <module>
            <web>
               <web-uri>myproject2.war</web-uri>
               <context-root>/myproject2</context-root>
            </web>
         </module>
         
         <module>
            <ejb>myproject2.jar</ejb>
         </module>
         
         <!-- Seam and EL -->
         <module>
             <ejb>jboss-seam.jar</ejb>
         </module>
         
      </application>
      
      



      I can access these applications via :




      I would like to access these applications using :




      creating virtual hosts.


      I read the documentation here and here and tried many things but I get it working.



      I edited my hosts file :


      127.0.0.1        myproject1
      127.0.0.1        myproject2
      



      Then I edited $JBOSSHOME/server/default/deploy/jboss-web.deployer/server.xml


      <Engine name="jboss.web" defaultHost="myproject1">
          <Host name="myproject1"    appBase="???/myproject1"/>
          <Host name="myproject2" appBase="???/myproject2"/>
      </Engine>
      
      



      I can't figure out what should I write in the appBase field in the JBoss environment.


      Then I created :


      - $JBOSSHOME/server/default/deploy/jboss-web.deployer/conf/jboss.web/myproject1/ROOT.xml
      



      containing this :


      <Context docBase="/myproject1"
               path="" />
      



      and :


      - $JBOSSHOME/server/default/deploy/jboss-web.deployer/conf/jboss.web/myproject2/myproject2.xml
      



      containing this :


      <Context docBase="/myproject2"
               path="" />
      



      I even tried to create a jboss-web.xml file as described here : http://www.jboss.org/community/wiki/VirtualHostswithJBossAS
      but when I try to load http://myproject1:8080 I get a white page and nothing loads.


      Thank you for your help.


      Have a good week-end :-)
      Romain