Httpd mod cluster : Change AJP to HTTP connector
samjose Feb 16, 2015 5:43 AMI have a two node Wildfly8.0.0 cluster. The cluster configuration is working good with mod_cluster with AJP. Now I want to try with HTTP connector instead of AJP.
Following are the changes I did.
Changed
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
To
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
[commented out proxy_ajp_module and added proxy_http_module]
In my domain.xml in master application server node:
Changed
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" connector="ajp">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
To
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" connector="default">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>
[“default” is the name of the http listener]
With these changes I can see the from log files AJP has been replaced by HTTP.
The cluster is working with one issue.
When I try to open the login page of my application with url http://x.x.x.x/star the login page opens with url http://x.x.x.x:8330/star/login.xhtml
[250 is my port-offset in host.xml]
When I try the same test case with AJP connector it opens login page without port in the url http://x.x.x.x/star/login.xhtml
Looking for Suggestions/Pointers to avoid port from the url.
My httpd version is 2.4.6
Adding excerpt from httpd.conf
LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule manager_module modules/mod_manager.so
LoadModule cluster_slotmem_module modules/mod_cluster_slotmem.so
LoadModule advertise_module modules/mod_advertise.so
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
...
<IfModule manager_module>
Listen 1x.1x.1x.x:6666
ManagerBalancerName my-cluster
<VirtualHost *:6666>
<Location />
Require all granted
Allow from 1x.1x.1x
</Location>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
EnableMCPMReceive On
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Require all granted
Allow from 1x.1x.1x
</Location>
</VirtualHost>
</IfModule>
Excerpt from domain.xml from master node
<subsystem xmlns="urn:jboss:domain:modcluster:1.2">
<mod-cluster-config advertise-socket="modcluster" proxy-list="1x.1x.1x.x:6666" connector="default">
<dynamic-load-provider>
<load-metric type="cpu"/>
</dynamic-load-provider>
</mod-cluster-config>
</subsystem>