Introduction
This is a supplementary article for the article Server Clustering Guide. Instead of running Apache 2 as the load balancer on a Linux-based system, we are going to use Windows-based Apache 2 instead. In this example, we are going to use Apache Lounge.
Apache Lounge would accept SSL connection from the end clients and forward the requests to the Joget nodes that are also listening on SSL protocol too.
Deployment Guide
Prerequisites
- Prepare .crt and .key files for SSL configurations.
In this guide, our files are:-- C:\Users\cat\apache-selfsigned.crt
- C:\Users\cat\apache-selfsigned.key
- Both node 1 and node 2 are accepting SSL connections.
In this guide, the paths are:-- https://server1:443
- https://server2:443
Download Apache Lounge
- Download Apache Lounge from http://www.apachelounge.com/download/
- Extract to your preferred location.
- For the purpose of this guide, we are going to extract it to c:/Users/cat/Apache24.
Server Clustering Guide
Please follow the steps in Server Clustering Guide 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 LoadModule ssl_module modules/mod_ssl.so
Configure the variable SRVROOT to point to your working path.
Define SRVROOT "c:/Users/cat/Apache24"
Append ServerName right after the line above with your domain name.
ServerName mysamplejoget.com
Look for Listen, and add the following line after it.
#Listen 12.34.56.78:80 Listen 443
Append these to the end of the file.
<VirtualHost *:*> SSLEngine on SSLCertificateFile "C:\Users\cat\apache-selfsigned.crt" SSLCertificateKeyFile "C:\Users\cat\apache-selfsigned.key" SSLProxyEngine On ServerAdmin support@example.com ErrorLog "C:\Users\hugol\Downloads\httpd-2.4.58-win64-VS17\Apache24\joget\logs\jwsite-error.log" CustomLog "C:\Users\hugol\Downloads\httpd-2.4.58-win64-VS17\Apache24\joget\logs\jwsite-access.log" combined DirectoryIndex index.html index.htm <Proxy balancer://wscluster> BalancerMember ws://server1:443 route=node01 BalancerMember ws://server2:443 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 https://server1:443 route=node01 BalancerMember https://server2:443 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 to set it up as a Windows service, please see https://httpd.apache.org/docs/2.4/platform/windows.html#winsvc.