Skip to content

Instantly share code, notes, and snippets.

@Karm
Created June 24, 2013 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Karm/5850401 to your computer and use it in GitHub Desktop.
Save Karm/5850401 to your computer and use it in GitHub Desktop.
mod_cluster and ProxyPass, /static from httpd instance
# mod_proxy_balancer should be disabled when mod_cluster is used
LoadModule proxy_cluster_module modules/mod_proxy_cluster.so
LoadModule slotmem_module modules/mod_slotmem.so
LoadModule manager_module modules/mod_manager.so
LoadModule advertise_module modules/mod_advertise.so
# Set to some _local_ place (absolute path), definitely not an NFS...
MemManagerFile /home/mbabacek/EAP6/cache/mod_cluster
ServerName 127.0.0.1:8888
ManagerBalancerName mycluster
<IfModule manager_module>
Listen 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
# See http://docs.jboss.org/mod_cluster/1.2.0/html_single/#d0e485
CreateBalancers 1
ProxyPassMatch ^/static/ !
# balancer must match the ManagerBalancerName
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=on
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost on
# One can play with ProxyPassReverseCookieDomain and ProxyPassReverseCookiePath in order
# to control behavior in cases like /mydyncontext/staticpath
<Directory />
Order deny,allow
Deny from all
# Maybe not a very good idea for production :-)
Allow from all
</Directory>
# We want balancer advertising so as workers can join
# without prior proxy-list configuration.
ServerAdvertise on
# This is the only VirtualHost that will accept messages from workers.
EnableMCPMReceive
# Where is the mod_cluster manager console?
# One can tweak what's displayed there: docs.jboss.org/mod_cluster/1.2.0/html_single/#d0e631
<Location /mod_cluster_manager>
SetHandler mod_cluster-manager
Order deny,allow
Deny from all
# Lat's change it prior going to production.
Allow from all
</Location>
</VirtualHost>
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment