4 Replies Latest reply on Mar 3, 2005 10:06 PM by atait

    virtual hosts / jboss-web.xml

    Wiley Snyder Newbie

      I asked this question in the beginner corner, no luck I think I had it in the wrong place so please forgive me... I still can't seem to figure out how to get myste.com AND www.mysite.com to work???

      This is my jboss-web.xml ...

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <context-root />
      <virtual-host>www.mysite.zzzz</virtual-host>
      <virtual-host>mysite.zzzz</virtual-host>
      </jboss-web>
      


      I've also tried

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-web>
      <context-root />
      <virtual-host>www.mysite.zzzz</virtual-host>
      <Alias>mysite.zzzz</Alias>
      </jboss-web>
      


      Am I doing something right? Both these examples do not work... heeeeeeeelp




        • 1. Re: virtual hosts / jboss-web.xml
          Chris Lamprecht Newbie

          Just put one entry in your jboss-web..xml:

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


          And then add the [Alias] tag to your [Host] entry in server.xml (under deploy/jbossweb-tomcat50.sar):

          ...
          <Host name="www.foobar.com">
           <Alias>www2.foobar.com</Alias>
           <Alias>foobar.com</Alias>
          ...
          </Host>


          • 2. Re: virtual hosts / jboss-web.xml
            Wiley Snyder Newbie

            That did the trick.

            Thank you

            • 3. Re: virtual hosts / jboss-web.xml
              Erik Turesson Novice

              Do you have to update the tomcat configuration file too?
              Or is it enough to update the jboss-web.xml inside the war.

              I do only update the jboss-web.xml file and it works. However it complains at startup about some vhost that is not defined.
              What does this error mean?

              I do not like to update central configuration files. I think that war and ear shall be selfcontained. To deploy them I just whant to put them in the deploy directory.

              /Erik

              • 4. Re: virtual hosts / jboss-web.xml
                atait Newbie

                I get the following message in my log at deploy time when I use the jboss-web.xml config below, but it still works correctly:

                [Servlet] Registration is not done -> stop

                Here's the jboss-web.xml config:

                <?xml version="1.0" encoding="UTF-8"?>
                <jboss-web>
                <context-root>/</context-root>
                <virtual-host>host1</virtual-host>
                <virtual-host>host2</virtual-host>
                </jboss-web>

                Can someone elaborate on why this message is posted to the log?