Clustering with Apache Lounge on Windows

Introduction

This is a supplementary article for the article Server Clustering. It describes how to use Apache Lounge on a Windows-based system as the load balancer instead of using Apache 2 on a Linux-based system. Apache Lounge will handle HTTP connections from clients and forward requests to Joget nodes, which are also configured to use HTTP.

Download apache lounge

To download apache lounge, follow the steps below:

  1. Download Apache Lounge from http://www.apachelounge.com/download/
  2. Extract to your preferred location.
  3. For the purpose of this guide, we are going to extract it to c:/Users/cat/Apache24.

Server clustering 

Follow the steps in Server Clustering except for Configure Load Balancer section.

Configure Load Balancer

Edit the file \Apache24\conf\httpd.conf.

Uncomment these lines to enable the necessary modules.

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

Configure the variable SRVROOT to point to your working path.

Define SRVROOT "c:/Users/cat/Apache24"

Append these to the end of the file.

<VirtualHost *>
    ServerAdmin support@example.com
    ErrorLog "C:\Users\cat\Apache24\joget\logs\jwsite-error.log"
    CustomLog "C:\Users\cat\Apache24\joget\logs\jwsite-access.log" combined
    DirectoryIndex index.html index.htm
    <Proxy balancer://wscluster>
        BalancerMember ws://server1:8080 route=node01
        BalancerMember ws://server2:9090 route=node02
        Require all granted
    </Proxy>
    ProxyPass /jw/web/applog balancer://wscluster/jw/web/applog stickysession=JSESSIONID|jsessionid
    ProxyPassReverse /jw/web/applog balancer://wscluster/jw/web/applog
    <Proxy balancer://cluster>
        BalancerMember http://server1:8080 route=node01
        BalancerMember http://server2:9090 route=node02
        Require all granted
    </Proxy>
    ProxyPass /jw balancer://cluster/jw stickysession=JSESSIONID|jsessionid
    ProxyPassReverse /jw balancer://cluster/jw
    ProxyPreserveHost On
</VirtualHost>

Create a new folder at this location to host the log files.

  • C:\Users\cat\Apache24\joget\logs

Start the Apache server

httpd.exe

Once you have verified that it is working, you may consider setting it up as a Windows service (see https://httpd.apache.org/docs/2.4/platform/windows.html#winsvc).

Created by Julieth Last modified by Aadrian on Dec 13, 2024