9 Replies Latest reply on Sep 13, 2016 3:33 AM by jfclere

    Can't serve multiple contexts

    jplorier

      Hi,

       

      I'm quite rookie to modcluster and I need to publish two contexts in different server groups but I can't get the to work. I have context 1 in a server group on port 8080 and context 2 on 8180. Modcluster is able to see both apps correctly except for the alias it detects. (in one context it uses one correct alias and another that is not set in the domain, in the other, uses de same alias that in the first context even when it has a different alias defined and doesn't have the incorrect autodetected alias).

      The jboss domain has configured the default virtual server to use context 1 ear. If I request the apps from the load balancer, I can get them right, but If I request them to apache, I get test page for root context and 404 for the defined contexts.

      Anyone can help me to figure out what I'm doing wrong?

      Regards:

       

      PS: I'm running apache 2.4 on Centos 7 with modcluster 1.3.1.8, jboss EAP 6.3.4

       

      Regards

        • 1. Re: Can't serve multiple contexts
          jfclere

          not sure I get what you are trying to do...

          Basically mod_cluster_manager should display the aliases and context if you don't see what you expect it won't work.

          Additionally EAP 6.3.4 is old, can't you use a newer version?

          • 2. Re: Can't serve multiple contexts
            jplorier

            Hi,

             

            First, sorry for my mistake, it's eap 6.4.3.

             

            I can see the contexts I expect to see in the manager. I also see that the aliases are incorrect and can't find where it's getting them.

             

            I have two apps, broker and storedprox. Each in a different server group, broker on port 8080 with alias prep.hg.sucive.gub.uy and showing that alias and broker in the manager, storedproc on port 8180 with alias stored.prep.hg.sucive.gub.uy and showing in the manager the same alias that broker (which is wrong).

            I checked that server alias is right for both virtual servers in EAP and in neither case, there's a broker alias defined.

            If I point to prep.hg.sucive.gub.uy, I should be answered by the default virtual server, but I'm getting apache test page. If I add either context, I get a 404 (prep.hg.sucive.gub.uy/broker or prep.hg.sucive.gub.uy/storedproc)

             

            If you need me to clarify further, please let me know.

            Regards

            • 3. Re: Can't serve multiple contexts
              jfclere

              you need to define the virtual-server with its aliases in the web subsystem and use the same virtual-server in jboss-web.xml of the web-app.

              • 4. Re: Can't serve multiple contexts
                jplorier

                Hi,

                 

                Sorry for the late reply but I had to ask the dev team to change the jboss-web.xml. They added the tag <virtual-host>broker</virtual-host> to the file. The result is the same. This is the output of the modcluster_manager:

                 

                mod_cluster/2.0.0.Alpha1-SNAPSHOT

                start of "httpd.conf" configuration

                mod_proxy_cluster.c: OK

                mod_sharedmem.c: OK

                Protocol supported: http AJP

                mod_advertise.c: OK

                Server: lb01.prep.sucive.gub.uy

                Server: lb01.prep.sucive.gub.uy VirtualHost: 192.168.110.10:8000 Advertising on Group 224.0.1.105 Port 23364 for http://192.168.110.10:8000 every 10 seconds

                end of "httpd.conf" configuration

                 

                Auto Refresh show DUMP output show INFO output

                Node b681457d-af17-3564-87af-de21e6dd9531 (http://192.168.120.51:8180):

                Enable Contexts Disable Contexts Stop Contexts

                Balancer: brokerPREP,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 2,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100

                Virtual Host 1:

                Contexts:

                /storedproc, Status: ENABLED Request: 0 Disable Stop 

                Aliases:

                broker prep.hg.sucive.gub.uy 

                Node cab8314f-e5c4-3e73-8df7-80ce23f982b0 (http://192.168.120.50:8080):

                Enable Contexts Disable Contexts Stop Contexts

                Balancer: brokerPREP,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 2,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100

                Virtual Host 1:

                Contexts:

                /broker, Status: ENABLED Request: 0 Disable Stop 

                Aliases:

                prep.hg.sucive.gub.uy broker 

                Node 2f6cc401-32c3-325f-858c-560c0d735517 (http://192.168.120.51:8080):

                Enable Contexts Disable Contexts Stop Contexts

                Balancer: brokerPREP,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 2,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100

                Virtual Host 1:

                Contexts:

                /broker, Status: ENABLED Request: 0 Disable Stop 

                Aliases:

                prep.hg.sucive.gub.uy broker 

                Node ff0172b7-d027-3d85-8f60-8f3feea3707c (http://192.168.120.50:8180):

                Enable Contexts Disable Contexts Stop Contexts

                Balancer: brokerPREP,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 2,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100

                Virtual Host 1:

                Contexts:

                /storedproc, Status: ENABLED Request: 0 Disable Stop 

                Aliases:

                broker prep.hg.sucive.gub.uy 
                • 5. Re: Can't serve multiple contexts
                  jplorier

                  I'm adding jboss virtual server configuration:

                   

                  ls virtual-server=broker

                  configuration                      alias=["prep.hg.sucive.gub.uy"]    enable-welcome-root=false

                  rewrite                            default-web-module=broker2013.ear  name=broker

                  [domain@192.168.xx.xx:9999 subsystem=web] ls virtual-server=storedproc

                  configuration                                         alias=["stored.prep.hg.sucive.gub.uy"]                enable-welcome-root=false

                  rewrite                                               default-web-module=PROJECT_NAME-ear-1.0-SNAPSHOT.ear  name=storedproc

                  [domain@192.168.xx.xx:9999 subsystem=web] ls virtual-server=default-host

                  configuration                      alias=["prep.hg.sucive.gub.uy"]    enable-welcome-root=false

                  rewrite                            default-web-module=broker2013.war  name=default-host

                  [domain@192.168.xx.xx:9999 subsystem=web]

                  • 6. Re: Can't serve multiple contexts
                    jplorier

                    ./subsystem=web:read-resource

                    {

                        "outcome" => "success",

                        "result" => {

                            "default-session-timeout" => 30,

                            "default-virtual-server" => "broker",

                            "instance-id" => undefined,

                            "native" => false,

                            "configuration" => {

                                "container" => undefined,

                                "static-resources" => undefined,

                                "jsp-configuration" => undefined

                            },

                            "connector" => {

                                "http" => undefined,

                                "ajp" => undefined

                            },

                            "valve" => undefined,

                            "virtual-server" => {

                                "default-host" => undefined,

                                "broker" => undefined,

                                "storedproc" => undefined

                            }

                        }

                    • 7. Re: Can't serve multiple contexts
                      jplorier

                      just in case, I've now installed mod_cluster 1.3.1 as I was running an alpha version to check if something changes.

                      Regards

                      • 8. Re: Can't serve multiple contexts
                        jplorier

                        Hi there,

                         

                        Can you help me out with this? Maybe it's a simple configuration I'm missing, but I'm stuck without ideas to try any further.

                        Regards

                        • 9. Re: Can't serve multiple contexts
                          jfclere

                          It looks OK are you do the correct requests aka something like?

                          curl -v http://prep.hg.sucive.gub.uy:port/storedproc/

                           

                          port being the port using in httpd (main server or virtualhost), basically the Host: prep.hg.sucive.gub.uy is what is routing to the right application.