Altair® Panopticon

 

Apache HTTP Server

The following section describes the steps on how to install and configure an Apache Load Balancer. The guide expects that the Apache HTTP Server is being setup for the first time. Please note that the installation steps might vary depending on your environment. These steps cover how to install and configure an Apache HTTP Server with proxy support for Microsoft Windows.

1.     Download the Apache HTTP Server from the official webpage: https://httpd.apache.org/download.cgi

2.     Unzip and copy the files to a folder.

3.     Configure the proxy by opening the httpd.conf  file in the conf folder.

4.     Update the SRVROOT  variable. The value must be updated to the file location of the Apache HTTP server.

Define SRVROOT "/Path/To/Apache" ServerRoot "${SRVROOT}"

 

5.     Modules are required to be loaded to make the Apache HTTP Server into a load balancer. Add or uncomment the following lines in the httpd.conf  file.

LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule headers_module modules/mod_headers.so LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule slotmem_shm_module modules/mod_slotmem_shm.so

 

6.     Configure the logic for the load balancer and how requests should be passed.

In the following example, we have configured the load balancer to listen to port 10080 and to use two balancer members (Route 1 and Route 2). The example will also set a session cookie named ROUTEID. The cookie contains the route that the user took and will continue to use throughout the active session.

<VirtualHost *:10080> ServerAdmin webmaster@localhost ProxyPreserveHost On Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED <Proxy "balancer://panopticoncluster"> BalancerMember "http://localhost:8080/panopticon" route=1 BalancerMember "http://localhost:8081/panopticon" route=2 ProxySet stickysession=ROUTEID </Proxy> ProxyPass /panopticon balancer://panopticoncluster ProxyPassReverse /panopticon balancer://panopticoncluster ServerName localhost:8080 </VirtualHost>

7.     The Apache HTTP Server can be started when all the configurations are in place. This is done by running the httpd script or application in the Apache binfolder.