5.0

20 vFabric Web Server
20
Configuring vFabric Web Server
Instances
Two tc Runtime instances are running at the following two hosts and port numbers:
http://192.168.0.203:8081
http://192.168.0.203:8082
The two tc Runtime instances are running on the same computer, are part of the same installation and their respective
CATALINA_BASE variables are as follows:
/home/tcserver/vfabric-tc-server-standard/instanceOne
/home/tcserver/vfabric-tc-server-standard/instanceTwo
Each tc Runtime instance is configured exactly the same (other than the value of the various ports).
You have deployed the same application to both tc Runtime instances and the URL context is the same in both instances: /
my-app.
You want all users of the application to first go through the front-end vFabric Web Server instance, and any evidence of the
backend tc Runtime instances upon which the application is actually deployed should be hidden from the user.
vFabric Web Server is installed on a different computer than vFabric tc Server. The name of the particular vFabric Web Server
instance is lb-server and its home directory is /opt/vmware/vfabric-web-server/lb-server.
You want to configure sticky sessions, which means that the vFabric Web Server instance always routes the requests for a
particular session to the same tc Runtime instance that serviced the first request for that session.
You want to use the HTTP protocol for all communication between the vFabric Web Server and the tc Runtime instances.
The load balancing described in this procedure is very simple, although you have many options available to further customize
it. At appropriate locations in the procedure, links to the Apache HTTP Server documentation are provided for additional
configuration options not covered by this specific scenario. Adapt the procedure for your particular environment.
As part of the procedure, you update the configuration files of both the vFabric Web Server instance and the two tc Runtime
instances.
Prerequisites
Install vFabric Web Server on your platform and create a new instance.
Install vFabric tc Server on the same or different computer as vFabric Web Server, and create two more instances. Make note
of the host and port numbers of the two instances. See the vFabric tc Server documentation for details.
Deploy the same application to the two tc Runtime instances.
Procedure
To configure load balancing for the scenario described in the introduction to this section, follow these steps:
1. On the computer on which vFabric Web Server is installed, stop the instance, if it is currently running. Following the
example and assumptions:
prompt# cd /opt/vmware/vfabric-web-server/lb-server
prompt# bin/httpdctl.sh stop
2. Open the httpd.conf configuration file of the vFabric Web Server instance and ensure that the three required
LoadModule directives (proxy_balancer_module, mod_proxy, and mod_proxy_http, are present and enabled
(in other words, are not commented out):
LoadModule proxy_balancer_module "VFWS-INSTALL/httpd-2.2/modules/mod_proxy_balancer.so"