Modcluster can't serve multiple contexts
c350 Jul 14, 2017 1:25 PMHi, first english isn't my native language, so please tell me if something isn't understandable.
I've one node as RP running Apache 2.4.6 and Modcluster and my backends are a cluster (two nodes) of JBoss EAP 6.4.3, in them are running two different applications, each in his server group.
Each app serves his context, one is "storedproc" and the other is "broker", in the mod cluster manager page, I can see this:
Node: [1],Name: cab8314f-e5c4-3e73-8df7-80ce23f982b0,Balancer: brokerPREP,LBGroup: ,Host: 192.168.120.50,Port: 8080,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 2,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [2],Name: ff0172b7-d027-3d85-8f60-8f3feea3707c,Balancer: brokerPREP,LBGroup: ,Host: 192.168.120.50,Port: 8180,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 2,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [3],Name: 2f6cc401-32c3-325f-858c-560c0d735517,Balancer: brokerPREP,LBGroup: ,Host: 192.168.120.51,Port: 8080,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 2,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [4],Name: b681457d-af17-3564-87af-de21e6dd9531,Balancer: brokerPREP,LBGroup: ,Host: 192.168.120.51,Port: 8180,Type: http,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 2,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Vhost: [1:1:1], Alias: broker
Vhost: [1:1:2], Alias: prep.hg.sucive.gub.uy
Vhost: [2:1:3], Alias: broker
Vhost: [2:1:4], Alias: prep.hg.sucive.gub.uy
Vhost: [4:1:5], Alias: broker
Vhost: [4:1:6], Alias: prep.hg.sucive.gub.uy
Vhost: [3:1:7], Alias: broker
Vhost: [3:1:8], Alias: prep.hg.sucive.gub.uy
Context: [1:1:1], Context: /, Status: ENABLED
Context: [2:1:2], Context: /storedproc, Status: ENABLED
Context: [4:1:3], Context: /storedproc, Status: ENABLED
Context: [3:1:4], Context: /, Status: ENABLED
The desired behavior is that when I do for example a
curl -iLv http://prep.hg.sucive.gub.uy or curl -iLv http://prep.hg.sucive.gub.uy/broker
I should be redirected to the broker app, and when
curl -iLv http://prep.hg.sucive.gub.uy/storedproc
is executed, the redirect must go to the storedproc app, but this isn't happening, currently what happens if I execute the curl with /broker or /storedproc is that I get a 404 error, and in the other hand if I go to the root, it gives me the default welcome test page of apache.
My actual config of modcluster is:
#
# This is mod_cluster module configuration file. Please refer to
# mod_cluster README for more information on how to enable mod_cluster.
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
# MemManagerFile /var/cache/httpd
#
Listen 192.168.110.10:8000
<VirtualHost 192.168.110.10:8000>
ManagerBalancerName brokerPREP
EnableMCPMReceive on
#AdvertiseFrequency 5
ServerAdvertise OFF
AllowDisplay On
<Location />
Require all granted
Order allow,deny
#Allow from all
Allow from 192.168.120.50
Allow from 192.168.120.51
Allow from 192.168.110.10
Allow from 192.168.90.254
# Include conf/auth/hgonly.conf
</Location>
#<Location /consulta_deuda>
# Order deny,allow
# Deny from all
#</Location>
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Require all granted
Order allow,deny
#Allow from all
Allow from 127.0.0.1
Allow from 192.168.110.10
Allow from 192.168.90.254
#Allow from 172.18.
#Allow from 192.168.200.
</Location>
ErrorLog logs/mod_cluster_error_log
CustomLog logs/mod_cluster_access_log common
</VirtualHost>
And in the JBoss side I have:
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" proxy-list="192.168.110.10:8000" balancer="brokerPREP" advertise="false" excluded-contexts="invoker,jbossws,juddi,console" sticky-session-force="false" connector="http">
<dynamic-load-provider>
<load-metric type="busyness"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
<subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="broker" native="false">
<configuration>
<jsp-configuration display-source-fragment="false"/>
</configuration>
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
<virtual-server name="default-host" enable-welcome-root="false" default-web-module="broker2013.war">
<alias name="prep.hg.sucive.gub.uy"/>
</virtual-server>
<virtual-server name="broker" enable-welcome-root="false" default-web-module="broker2013.ear">
<alias name="prep.hg.sucive.gub.uy"/>
</virtual-server>
<virtual-server name="storedproc" default-web-module="PROJECT_NAME-ear-1.0-SNAPSHOT.ear">
<alias name="stored.prep.hg.sucive.gub.uy"/>
</virtual-server>
</subsystem>
Also, the dev team inside de jboss-web.xml which is inside the .ear puts:
<jboss-web>
<virtual-host>broker</virtual-host>
</jboss-web>
Also as you could see in the config, in jboss for storedproc is configured an alias "stored.prep.hg.sucive.gub.uy", which isn't even in the modcluster side.
I'm running out of ideas about which could be the root cause of this issue, I hope someone could help me figure out this, idk, maybe is just a misconfiguration and I don't see it.
Thanks a lot!
Regards!