3 Replies Latest reply on Oct 15, 2002 6:57 PM by Julian Gosnell

    Using virtual hosts with JBoss-Jetty

    Marcus Pecher Newbie

      I want to be able to have the same instance of JBoss-Jetty take request for
      different hosts (www.site1.com --> site1.ear and www.site2.com --> site2.ear) etc

      I searched the manual, Jetty JavaDoc etc but don't seem to be able to get this working.
      Ok, by my understanding I need to:

      1. Modify the jboss-service.xml, adding:


      2. Modify the jboss-web.xml for site1.war and add

      This doesn't seem to work (even though no exceptions etc are thrown).

      Does anyone know the how to do this? (The doco doesn't give any good/complete examples).


        • 1. Re: Using virtual hosts with JBoss-Jetty
          Julian Gosnell Expert

          There are two deployment mechanisms available to you :

          1) Jetty's original, proprietary configuration file (now the ConfigurationElement in jboss-service.xml).

          2) Via JBoss (deploy/, JMX, etc...)

          If you use both, you will most likely confuse Jetty.

          To get back to your problem, look back through this forum for a posting of the JBoss/Jetty FAQ. I think it contains an item on how you can attach an app to virtual hosts via a WEB-INF/jetty-web.xml.

          I will be updating the FAQ tonight with another item. If I do not see the item that I am describing already there, I will see if I can find the mails that went around about this and add something to the FAQ.

          Let me know how you get on.


          • 2. Re: Using virtual hosts with JBoss-Jetty
            Marcus Pecher Newbie

            Thanks Jules,

            Got it working using only <virtual-host> tag inside the jboss-web.xml for each .ear/.war (thanks Jan Bartel).

            I suppose what confused me was some conflicting doco.
            In the Jetty forum, Greg Wilkins mentioned that using the

            > test.mydomain.com
            > /
            > <SystemProperty name="jetty.webapp" default
            > ="./webapps/default"/>
            > /etc/webdefault.xml
            > false

            is not recommended for JBoss-Jetty bundle. But nowhere in the doco does it mention this.

            Maybe when you update the FAQ, you can point out any differences like this b/w using Jetty by itself and
            bundled with JBoss etc.


            • 3. Re: Using virtual hosts with JBoss-Jetty
              Julian Gosnell Expert

              I've updated the FAQ - see the 'How do I configure the Jetty Service ?'