4 Replies Latest reply on Jun 16, 2003 11:15 AM by aidano

    Virtual Hosts with Apache/Tomcat/JBoss

    aidano

      I'm trying to setup a couple of virtual hosts, each pointing to a separate EAR file in my JBoss installation.

      I've searched the posts here, but have been unable to find a definitive explanation of how to do this with Apache along with Tomcat and JBoss.

      Can anyone point me in the right direction?

      Thanks, Aidan

        • 1. Re: Virtual Hosts with Apache/Tomcat/JBoss
          clevanger

          Hi,

          In apache you need to mount the context /* (with JKMount or equivilant)

          then in your war file in th WEB-INF directory, include a file called jboss-web.xml and in that file put

          <jboss-web>
          <context-root>/</context-root>
          <virtual-host>whatever.com</virtual-host>
          </jboss-web>

          I hope I understood your question

          • 2. Re: Virtual Hosts with Apache/Tomcat/JBoss
            aidano

            Clevanger - Thanks for the answer.

            Are there any additional operations to perform when my WAR files are deployed inside EARs as opposed to just WARs on their own?

            • 3. Re: Virtual Hosts with Apache/Tomcat/JBoss
              aidano

              Actually - that doesn't work for me. The first EAR deploys ok, but when JBoss goes to deploy my second, I get this exception:

              org.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
              e: (java.lang.IllegalArgumentException: addChild: Child name '' is not unique)

              Now this is obviously because I have defined 2 WARs with the context of '/', but isn't this what I need to do to configure 2 separate virtual hosts?

              • 4. Re: Virtual Hosts with Apache/Tomcat/JBoss
                aidano

                Just to update - I got this going finally after reading the Quickstart guide (doh!) and finding that I had to edit tomcat41-service.xml to include my virtual host details.

                I don't understand why nobody else has mentioned this - is everyone using Jetty?