This page describes an older version of the product. The latest stable version is 16.4.

Apache Load-Balancer

XAP comes with a built-in utility allowing you to dynamically update an Apache httpd web server load-balancing configuration, based on deployed web applications.


Here is an example configuration of the apache httpd to load-balance web requests between the different web servers.

Install apache httpd.

Create a file named HttpSession.conf located at \conf\gigaspaces

Place the following within the HttpSession.conf file. The BalancerMember should be mapped to different URLs of your web servers instances. With the example below we have Tomcat using port 8080 and Websphere using port 9080.

<VirtualHost *:8888>
  ProxyPass / balancer://HttpSession_cluster/
  ProxyPassReverse / balancer://HttpSession_cluster/

  <Proxy balancer://HttpSession_cluster>
     BalancerMember route=HttpSession_1
     BalancerMember route=HttpSession_2
The IP should be replaced with IP addresses of the machine(s)/port(s) of WebSphere/Tomcat instances.

Configure the <Apache2.2 HTTPD root>\conf\httpd.conf to have the following:

Include "/tools/Apache2.2/conf/gigaspaces/*.conf"

LoadModule proxy_module modules/
LoadModule proxy_balancer_module modules/
LoadModule proxy_http_module modules/
LoadModule status_module modules/


ProxyPass /balancer !
<Location /balancer-manager>
    SetHandler balancer-manager

    Order deny,allow
    Deny from all
    Allow from
The /tools/Apache2.2 folder name should be replaced with your correct Apache httpd location. \ The IP should be replaced with appropriate IP addresses of the machine that is running apache.

Once you have the space running, Websphere running, Tomcat running, and Apache httpd configured, restart the Apache http. On windows you can use its service.


Once you performed the above steps, access the following URL:

You should have the web application running. Any access to the web application will be routed between Websphere and Tomcat. You can check this by accessing the Apache httpd balancer console:


You can shutdown Websphere or Tomcat and later restart these. Your web application will not lose its session data.

Multi-Site Deployment

When deploying the multi-site example you should change the shiro.ini for each site to match the local site Space URL. For example, to connect to the DE space you should have the web application use a shiro.ini with the following:

connector.url = jini://*/*/wanSpaceDE?groups=DE

To connect to the US space you should have the web application use a shiro.ini with the following:

connector.url = jini://*/*/wanSpaceUS?groups=US

Library dependencies

Developers should include the following dependencies in pom.xml file.