3 Replies Latest reply on Mar 18, 2014 6:58 PM by hostalp

    Virtual hosts separated by port (not by host name)

    hostalp

      I'm trying to get to work the following scenario:

       

      - httpd with mod_cluster

      - JBoss in domain mode at the same host

      - 2 app servers (still at that single host)

      - "almost" the same applications deployed at both of them, e.g. multiple conflicting context roots at single host

       

      As there are multiple web modules with conflicting context roots (and they can't be changed) with completely everything at single host, I'd like to separate them via port-based virtual hosts.

      E.g. httpd will listen at 2 ports, each one will serve requests from one set of applications.

      I can achieve this easily at WebSphere for example, however virtual hosts in JBoss seem to be limited to handling just multiple host names case.

       

      Yes, I can do that manually, e.g. set all rules in httpd by myself, but as there are lots of such web modules and they change (new added, context-roots modified etc) it would be better to get it working automatically via mod_cluster.

       

      Do you have any ideas how to achieve that?

        • 1. Re: Virtual hosts separated by port (not by host name)
          ctomc

          What version of Jboss AS?

           

          There ware some experimental patches to jbossweb that add support for this, but here is no elegant solution atm.

          There are few tricks how you can make it behave as you want but noting really elegant, see https://bugzilla.redhat.com/show_bug.cgi?id=995411 for example.

           

          However, in WildFly 8 with undertow subsystem we added support for scenarios like this from design up.

          take a look for example how to configure it https://community.jboss.org/message/857103

           

           

          --

          tomaz

          • 2. Re: Virtual hosts separated by port (not by host name)
            hostalp

            This is EAP 6.2.0 / AS 7.3.0

            I'll take a look at that property org.apache.catalina.connector.USE_IP_PORT_FOR_ALIAS, though the other thing is how these aliases will be pushed to the mod_cluster at httpd and if mod_cluster will handle them properly.

            • 3. Re: Virtual hosts separated by port (not by host name)
              hostalp

              So I setup system property org.apache.catalina.connector.USE_IP_PORT_FOR_ALIAS=true and virtual-server aliases like <alias name="*:80"/> etc.

              Direct access and access via mod_cluster with UseAlias 0 works, but there's no virtual host separation with UseAlias 0.

              With UseAlias 1 there's no match and request fails. I also tried with exact host names instead of wildcards (because it seems wildcards can't be used unfortunately: Can I use aliases with wildcards in mod_cluster and JBoss?) but there was no difference, it just doesn't work when ports are specified.

               

              So it seems mod_cluster can't handle such configurations. Is there anything to do about it? It's mod_cluster 1.2.6.

              Note that mod_cluster manager lists those aliases properly - *:80

               

              EDIT: moved to mod_cluster space which is probably more appropriate at this point