Q:

JBoss clustering overwrite some folder

I have JBoss clustring in use with Apache mod_cluster clustering. The modcluster configuration is the basic:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule slotmem_module modules/mod_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

Listen 10.33.144.3:6666
<VirtualHost 10.33.144.3:6666>

  <Directory />
    Order deny,allow
    Deny from all
    Allow from 10.33.144.
  </Directory>

  KeepAliveTimeout 60
  MaxKeepAliveRequests 0

  ManagerBalancerName mycluster
  AdvertiseFrequency 5

</VirtualHost> 

Now I have a folder (/documentation) in ServerRoot containing html files I would like to serve through Apache instead JBoss. How is it possible to configure this specific folder to be outside the mod_cluster forwarding? Now when I try to access the /documentation folder I am directed to one of the JBoss nodes instead apache. Thanks!

A:

Well, that's quite easy:
Add this directive just outside your mod_cluster enabled VirtualHost:
CreateBalancers: 1

Check out what it does: CreateBalancers docs. 
Furthermore, create a proxypass.conf in your conf.d/ with, e.g., this content:
ProxyPassMatch ^/documentation/ !
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=on
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost on

If you experience any problems with cookies, try to play with: ProxyPassReverseCookie* directives.
The aforementioned snippet simply says: if it's /documentation/, don't forward it to the workers and serve it locally.
Lat but not least, where is your EnableMCPMReceive directive? What version of mod_cluster is it? I stongly suggest against using anything older than 1.2.0, and I recommend using the latest 1.2.6 version. Absence of EnableMCPMReceive implies a very old mod_cluster without a crucial security fix...
HTH
Karm

