3 Replies Latest reply on Jun 17, 2003 8:46 PM by jonlee

    <virtual-host> Does not work ... why?

    hgarrett

      I have JBoss 3.2.2RC1 and all works fine.
      My web application is sandy.war and it is well
      deployed. I can access to it on http://localhost/sandy/index.jsp

      Then i read everything here about virtual-host and
      included on WEB-INF dir of my sandy app. a
      jboss-web.xml file in wich i wrote these lines:

      <jboss-web>
      <context-root>/</context-root>
      <virtual-host>www.sandy.dev</virtual-host>
      </jboss-web>

      i restarted JBoss Server and there seems everything is okay, yet now i cannot access to my app.

      http://www.sandy.dev does not work at all.

      http://localhost/sandy/index.jsp does not exist any more...

      What is happening here? Is this a problem of DNS routing? I have Win XP and IIS is turned OFF.

      ...i really need help from someone here... ;(

      thanx anyway.

        • 1. Re: <virtual-host> Does not work ... why?
          jonlee

          Since you have bound the web application to the root context, it is not available at http://localhost/sandy/index.jsp. It would work at http://localhost/index.jsp if you removed your virtual-host definition.

          As to the resolution of www.sandy.dev - does the definition for this exist in your DNS? Both the client and the server will need to know the machine to which this name refers. The server needs to know so that when it sees a request for this host and for the root context it realises that the contents of sandy.war is meant to be delivered.

          • 2. Re: <virtual-host> Does not work ... why?
            hgarrett

            thanx , it looks that XP Pro (wich has not DNS Service)
            could be a problem.

            I passed this config to W2000 Server on my network and now i want configure www.sandy.dev on DNS Service.

            How can i do this? How do i address it? to localhost IP?

            thanx again.

            http://www.sandy.dev does not work anywhere(neither server or client) even if it is on port 80 or 8080...

            • 3. Re: <virtual-host> Does not work ... why?
              jonlee

              It is a bit beyond the scope of this forum to cover network configuration topics such as DNS.

              However, in most instances, unless you are multihosting content on the one server it is easiest not to use virtual hosts in your Tomcat/Jetty configuration.

              This means that anyone who is trying to access the content can use http://localhost if they are on the same machine, http://www.sandy.dev if the DNS is configured or http://192.16.20.200 (or whatever is the IP address of the machine) - they will all get the same content.

              This is the simplest and easiest course until you become proficient at network administration and Jetty/Tomcat configuration. Later you can experiment with serving different to content for different name resolutions on the one machine.

              Hope that helps you get started.