1 Reply Latest reply on Jun 14, 2003 5:44 AM by cstura

    One war/ear, multiple virtual hosts

    Norton Newbie


      We are set up in our shop so that we have a development server, a test server, and a production server. Each server is named something different like 'dev.company.com', 'test.company.com', and 'www.company.com' (the last being production).

      I want to deploy the same ear to each of these machines so that it answers to the correct hostname.

      I am using jboss-web.xml and tried:


      But when I did, the virtual hosts were ignored. It works fine when there is only one virtual host element.

      I can see having three different jboss-web.xml files and copying the correct one to the war via ant, but I don't want to have to rebuild everytime I want to move from one server to another.

      Is there another way to accomplish this?



        • 1. Re: One war/ear, multiple virtual hosts
          cstura Newbie

          ok I can help you out here.

          jboss can't do this with the deployment descriptors but if you use tomcat bundled with jboss you can do this by configuring the deploy/jbossweb-tomcat/META-INF/jboss-service.xml file.

          set up a context defining your virtual host in tomcat.
          and then add

          mydevelopment site

          in your deployment descriptor include the production site url. and automatically your war will be deployed to both hosts. even if the production url doesn't exist in the dev environment.