How to use multiple virtual servers in JBoss EAP 6.2.0 (AS 7.3.0)
rbe1733 Apr 24, 2014 4:52 PMHi,
I'm looking for a way to make virtual servers work in JBoss EAP 6.2.
My goal is to isolate the deployed applications among multiple virtual hosts in Apache 2.2.
I read a lot of documentation and went through different forums, but i can't succeed in making mod_cluster work for this configuration.
I'm using domain mode with the following architecture :
VM1 : Apache + JBoss domain controller (no server group) : 192.168.100.200->202
VM2 : JBoss domain slave1 (2 server groups cluster1 and cluster2, host cluster11 (.211) in group cluster1, host cluster21 (.212), profile full-ha) : 192.168.100.210->212
VM3 : JBoss domain slave2 (2 server groups cluster1 and cluster2, host cluster12 (.221) in group cluster1, host cluster22 (.222), profile full-ha)) : 192.168.100.220->222
So, 2 clusters (cluster1 and cluster2) with 2 hosts for each of them.
The .200, .201 and .202 addresses are reserved for Apache virtual hosts.
What i would want Apache to do :
.200 : mod_cluster-manager (accessible only through http://xxx-jboss-master.vmdomain.org/mod_cluster-manager)
.201 : cluster-demo (accessible only through URL http://xxx-jboss-domain1.vmdomain.org/cluster-demo)
.202 : jboss-helloworld (accessible only through http://xxx-jboss-domain2.vmdomain.org/jboss-helloworld)
I use mod_cluster 1.2.6.
Here is the content of /etc/httpd/conf.d/jboss_cluster.conf
Listen 192.168.100.200:10001
Listen 192.168.100.201:10001
Listen 192.168.100.202:10001
CreateBalancers 0
UseAlias 1
ProxyPreserveHost On
<VirtualHost 192.168.100.200:10001>
ServerName xxx-jboss-master.vmdomain.org
<Directory />
Order deny,allow
Allow from all
</Directory>
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Order deny,allow
Allow from all
</Location>
KeepAliveTimeout 60
MaxKeepAliveRequests 0
AdvertiseFrequency 5
EnableMCPMReceive
ServerAdvertise on
</VirtualHost>
# domain1
<VirtualHost 192.168.100.201:10001>
ServerName xxx-jboss-domain1.vmdomain.org
<Directory />
Order deny,allow
Allow from all
</Directory>
ErrorLog logs/xxx-jboss-domain1_error_log
LogLevel debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/xxx-jboss-domain1_access_log combined
KeepAliveTimeout 60
MaxKeepAliveRequests 0
</VirtualHost>
# domain2
<VirtualHost 192.168.100.202:10001>
ServerName xxx-jboss-domain2.vmdomain.org
<Directory />
Order deny,allow
Allow from all
</Directory>
ErrorLog logs/xxx-jboss-domain2_error_log
LogLevel debug
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/xxx-jboss-domain2_access_log combined
KeepAliveTimeout 60
MaxKeepAliveRequests 0
</VirtualHost>
Here is the extract of domain.xml file :
<subsystem xmlns="urn:jboss:domain:web:1.5" native="false">
<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="master-host" default-web-module="mod_cluster-manager">
<alias name="xxx-jboss-master.vmdomain.org"/>
</virtual-server>
<virtual-server name="domain1-host" default-web-module="cluster-demo">
<alias name="xxx-jboss-domain1.vmdomain.org"/>
</virtual-server>
<virtual-server name="domain2-host" default-web-module="jboss-helloworld">
<alias name="xxx-jboss-domain2.vmdomain.org"/>
</virtual-server>
</subsystem>
After started domain controller, slave1, slave2 then httpd, the /mod_cluster-manager returns this :
I have no context nor aliases defined to handle my requests.
If i specify a default alias (<subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="master-host" native="false">), then the contexts are ok for mod_cluster-manager, cluster-demo and jboss-helloworld but the alias is unique (xxx-jboss-master.vmdomain.org). The 3 resources are accessible through http://xxx-jboss-master.vmdomain.org/<resource>
I can't figure out what i'm missing but i'm sure there's something ...
May you help ?
Thanks in advance for your support.
Kind regards.
Richard