issues with mod_cluster, virtual hosts, and jboss root context in JBoss EAP 6
kclair-rei Apr 19, 2013 7:23 PMWe're running Apache 2.2, mod_cluster 1.1, and JBoss EAP 6.0.1 (JBoss 7) on linux.
I'm trying to set up virtual hosts in JBoss without setting the virtual host in jboss-web.xml. The goal is for http://my.example.com/ to route through apache/mod_cluster and serve the application running on the context root /. The application runs fine in standalone mode. The application also runs fine when hit directly on an application server.
The apache configuration:
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule advertise_module modules/mod_advertise.so
LoadModule manager_module modules/mod_manager.so
Listen 192.168.1.2:6666
<VirtualHost 192.168.1.2:6666>
ManagerBalancerName mycluster
ServerAdvertise On
CreateBalancers 0
... other content snipped ...
</VirtualHost>
<VirtualHost *:80>
ServerAdmin my@email.address
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
ServerName my.example.com
</VirtualHost>
The application has this content for jboss-web.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<jboss-web>
<context-root>/</context-root>
</jboss-web>
The profile used by the server where the application is deployed is configured thusly:
<virtual-server name="default-host" enable-welcome-root="false" default-web-module="my-app-name">
<alias name="my.example.com"/>
</virtual-server>
And we have an app with a war file named my-app-name.war. (I have tried this with and without default-web-module provided, with the same result)
When I start jboss on the application servers, they appear to start the application without a problem:
[Server:MyApp] 12:17:34,786 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context:
[Server:MyApp] 12:17:34,811 INFO [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "my-app-name.war"
[Server:MyApp] 12:17:34,823 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.0.1.GA (AS 7.1.3.Final-redhat-4)
started in 35274ms - Started 502 of 649 services (146 services are passive or on-demand)
[Host Controller] 12:17:34,829 INFO [org.jboss.as.host.controller] (proxy-threads - 1) JBAS010919: Registering server MyApp
When I try to go to http://my.example.com, I get the apache error:
proxy: CLUSTER: (balancer://mycluster). All workers are in error state
This is the info dump from mod_cluster-manager. The application MyApp, which should be on the context root, is on ajp port 8039. As you can see, mod_cluster does not register either the alias my.example.com nor the context root /.
Node: [1],Name: e6381844-066b-3368-896e-f546e83010d7,Balancer: mycluster,LBGroup: ,Host: 172.19.49.159,Port: 8049,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [2],Name: 95a95bc1-7585-39dd-b701-1457b0804232,Balancer: mycluster,LBGroup: ,Host: 172.19.49.159,Port: 8019,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [3],Name: 8c2a290a-1f52-37af-8e71-85d69ca89339,Balancer: mycluster,LBGroup: ,Host: 172.19.49.160,Port: 8019,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [4],Name: f2b6d2e2-14d5-3d56-a09d-635c58272eb1,Balancer: mycluster,LBGroup: ,Host: 172.19.49.159,Port: 8039,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [5],Name: 9b147b77-5f46-3712-aad2-5569460c895f,Balancer: mycluster,LBGroup: ,Host: 172.19.49.160,Port: 8039,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Node: [6],Name: 5f622ae1-6233-3971-967d-4008d7e919f9,Balancer: mycluster,LBGroup: ,Host: 172.19.49.160,Port: 8049,Type: ajp,Flushpackets: Off,Flushwait: 10,Ping: 10,Smax: 1,Ttl: 60,Elected: 0,Read: 0,Transfered: 0,Connected: 0,Load: 100
Vhost: [2:1:1], Alias: 192.168.1.2
Vhost: [2:1:2], Alias: default-host
Vhost: [3:1:3], Alias: default-host
Vhost: [3:1:4], Alias: 192.168.1.2
Context: [2:1:1], Context: /OtherApp, Status: ENABLED
Context: [3:1:2], Context: /OtherApp, Status: ENABLED
The other application runs fine on http://192.168.1.2/OtherApp.