Monday, 8 April 2013

iNotes Deployment in HA Mode with Multiple Clusters using Apache Reverse Proxy - Part 2

In continuation to my first post:

In the last post, we tried setting up the Apache Reverse Proxy with Multiple Domino Clusters. Last week, we successfully implemented Apache Reverse Proxy in a unique way: 

Cluster size: 7 servers - 6 Mail Servers and 1 Admin Server. This setup ensures that all password changes are immediately available to all Servers. 

User's Mail file is available on either Server 1, 3, 5 OR Server 2, 4, 6. In this configuration 4 servers are in DC and 2 servers in DR. We want all traffic to land on Server 1 - 4 (DC). In case none of the DC Servers are available, then it should redirect request to Server 5, 6 (DR).

Instead of relying on the Domino Cluster Information, we have written Rules in Apache httpd.conf file to determine which Load Balancer Group a particular request should be redirected to. 

First, the formula used for Apache field in iNotes Web Redirect database: 

nodecookievalue:= @Name([CN];@NameLookup([NoUpdate];@UserName;"MailServer"));




This field will write Cookie values inotesses: Mail Server Name in lowercase. 

Second, Check if below modules are present & loaded in Apache Reverse Proxy

LoadModule rewrite_module modules/

LoadModule proxy_module modules/

LoadModule proxy_balancer_module modules/

LoadModule proxy_ftp_module modules/

LoadModule proxy_http_module modules/

LoadModule proxy_ajp_module modules/

LoadModule proxy_connect_module modules/

Third, in the httpd.conf file, add Rules to redirect user request to only that server where user's mailfile is present.

<VirtualHost *:443>


ProxyRequests off

SSLEngine On

SSLProxyEngine On

RewriteEngine On

SSLCertificateFile    /etc/apache2/ssl/webmail.crt

SSLCertificateKeyFile /etc/apache2/ssl/webmail.key

SSLCertificateChainFile /etc/apache2/ssl/chain.crt

ProxyPreserveHost On

<Proxy balancer://Cluster1/>

# loadfactor is added to ensure equal requests are sent to server01 and server02, while server03 will have lowest priority.

BalancerMember route=server01 loadfactor=50

BalancerMember route=server03 loadfactor=50

 BalancerMember route=server03 loadfactor=1

ProxySet lbmethod=byrequests


<Proxy balancer://Cluster2/>

BalancerMember route=server02 loadfactor=50

BalancerMember route=server04 loadfactor=50

 BalancerMember route=server03 loadfactor=1

ProxySet lbmethod=byrequests


ProxyPass / balancer://Cluster1/ stickysession=inotesses nofailover=Off

ProxyPassReverse /

ProxyPassReverse /


ProxyPass / balancer://Cluster2/ stickysession=inotesses nofailover=Off

ProxyPassReverse /

ProxyPassReverse /


RewriteCond %{HTTP_COOKIE} inotesses=server01 [NC]

RewriteRule ^/((mail|iNotes|icons|domjava)/.*)$ balancer://Cluster1/$1 [P]


RewriteCond %{HTTP_COOKIE} inotesses=server02 [NC]

RewriteRule ^/((mail|iNotes|icons|domjava)/.*)$ balancer://Cluster2/$1 [P]


RewriteCond %{HTTP_COOKIE} inotesses=server03 [NC]

RewriteRule ^/((mail|iNotes|icons|domjava)/.*)$ balancer://Cluster1/$1 [P]


RewriteCond %{HTTP_COOKIE} inotesses=server04 [NC]

RewriteRule ^/((mail|iNotes|icons|domjava)/.*)$ balancer://Cluster2/$1 [P]



Now, Stop & start httpd service.