1 Reply Latest reply on Jun 19, 2012 10:41 AM by ctomc

    Map a war to an HTTP connector / virtual host

    dabramov

      Hi,

       

      I'm porting to JBoss AS 7.1.1 from JBoss 4.04. I have two webapps A and B, one of which (say webpp A) is accessed programmatically so can use a large number of concurrent connections. We don't want A to starve out B, so in the past we've deployed A and B on different ports, backed by separated thread pools. In the past, this was implemented in the Tomcat server.xml by creating separate <Service> tags, each with their own <Connector> and <Host> elements. The host name was "localhotst" in both places, but one of then had a <Context> element which mapped the path to webapp A to this Service.

       

      I'd like to do the same thing in JBoss AS - Web 7. We've tried creating to separate instances of the JBoss Web subsystem, each with a connector with a different socket binding. One subsystem has a default-web-module which maps to our webapp which needs its own pool.

       

      JBoss complains that we we have duplicate subsystems. Ok, fair enough. But how can I configure things so different webapps are services by different connectors? Maybe just a way to give the subsystems a unique name?

       

       

      {code:xml}

      <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">

            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>

             <virtual-server name="default-host" enable-welcome-root="false">

                 <alias name="localhost"/>

             </virtual-server>

      </subsystem>

      <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">

             <connector name="other_lots_of_connections" protocol="HTTP/1.1" scheme="http" socket-binding="other_http_port"/>

             <virtual-server name="default-host" enable-welcome-root="false" default-web-module="other_webapp.war" >

                 <alias name="localhost"/>

             </virtual-server>

      </subsystem>

      {code}

       

       

      Thanks,

      -Dan

        • 1. Re: Map a war to an HTTP connector / virtual host
          ctomc

          Hi,

           

          what you are trying to achive is possible but with bit diffrent configuration:

           

           

          <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" >         
             <connector name="http" scheme="http" protocol="HTTP/1.1" socket-binding="http"/>
              <connector name="http-vs" scheme="http" protocol="HTTP/1.1" socket-binding="http" >
                          <virtual-server name="vs1" />
                          <virtual-server name="vs2" />
                      </connector>
                      <virtual-server name="default-host" enable-welcome-root="true">
                         <alias name="localhost" />
                         <alias name="example.com" />               
                      </virtual-server>
                      <virtual-server name="vs1" />
                      <virtual-server name="vs2" />
                  </subsystem>
          

           

          in this case we bind vs1 and vs2 virtual hosts to http-vs connector.

           

          but please note that this functionality was recently found to be broken, so the fix is not yet merged into upstream, but it is expected to be soon.

          for more about that see: https://github.com/jbossas/jboss-as/pull/2477

           

           

          --

          tomaz