Monday, 3 March 2014

Configuring iNotes in a multiple HomeMail Server scenario with a WebSphere Edge reverse proxy server

This is draft to remember the points.. I'll update the article in few days..

Most important part is to enable Cookies with JunctionRewrite:

JunctionRewrite On UseCookie

Configuration of iNotes Web Redirect Database: Use the MailServer option and configure the Domain name and Proxy Server URL.
The problem with MailServer option in "iNotes Redirect" db is that it only changes the first URL.. The other subsequent HTTP request still try to connect the Proxy server without appending homeserver name, and the error will coming up in normal scenario. Now, with use of Cookie, ReverseProxy server remembers which server was last used.

Therefore, now with this setup the first request will go to Server1.
After authentication, iwaredir.nsf database will redirect the first URL to "http://server.demo.com/server1" OR "http://server.demo.com/server2" based on Homemail server.
At this moment JunctionRewrite will store the server information in Cookie.
All subsequent requests to server without "/server1/" in URL will still be able to reach the correct server because of this cookie.

My server setup: 
Proxy: http://server.demo.com
Domino1: http://server1.demo.com:81
Domino2: http://server2.demo.com:82

Following are the rules that I have used:

map /server1.demo.com/* /server1/*
map /server2.demo.com/* /server2/*

JunctionReplaceURLPrefix http://server1.demo.com/* http://server.demo.com/server1/*
JunctionReplaceURLPrefix http://server2.demo.com/* http://server.demo.com/server2/*

proxy /server1/* http://server1.demo.com:81/*
proxy /server2/* http://server2.demo.com:82/*
proxy /* http://server1.demo.com:81/*

ReversePass http://server1.demo.com:81/* http://server.demo.com/server1/*
ReversePass http://server2.demo.com:82/* http://server.demo.com/server2/*

Please let me know if you want more details on how to setup the Websphere Cache Proxy Server.

Reference:
1. http://www.ibm.com/developerworks/lotus/library/ls-Configuring_IWA_Edge_ReverseProxy/index.html?ca=drs
2. http://www.ibm.com/developerworks/lotus/documentation/apacherproxy4inotes/

Tuesday, 3 December 2013

Forgot password application for Domino sever

Forgot Password Functionality for Domino

Important: This application require minimum Domino v8.5.3 along with Extension Library or Domino v9.0. It might not work with prior version of Domino, as advanced features of Extension library have been used.

*** Please ensure Session Authentication is Enabled on Domino Server ***

Application can be downloaded from OpenNTF site: http://www.openntf.org/internal/home.nsf/release.xsp?action=openDocument&documentId=8E96BEE9D9EC9AEB86257C3F00235928

Business Case:
This application implements the “Forgot Password” functionality for Domino. This feature is available today for almost any Web application which try to reset the password by sending notification to registered mail address. However, if you forget your Domino Webmail/Notes Client password, then you need to contact Administrators to reset the password. 
If the Organization has set the policy to change the passwords after every 60/90 days, then the password reset requests are more often. For a large Customer, we observed that around 60% Support requests are meant for Password Reset for Notes Client/Web Mail. 
This tools aims at minimizing such Support Calls by encouraging users to Register for Self Password Reset application. Users need to do one time registration and set their secret questions and answers. Once registered, users can use this application to Reset their Webmail/Notes Client passwords without engaging the Support team. 
Features of application:
- Reset password for both HTTP and Notes client (via ID Vault) in a single step.
- Front end application only consists of XPages design elements with total separation from data.
- No direct access to data via web interface/domino URL
- Secret answers secured with MD5 encryption.
- Forced  authentication for Registering/editing the profile.
- Used single XPage for password reset wizard with efficient use of Dynamic content control. Browser back button send use back to the start of wizard. Therefore, application having full control of flow.
- Lockout of Accounts and preventing unauthorized attempt to reset password. If tried to answer incorrectly more than 5 times. Lock-out is cleared automatically after defined interval via a Scheduled agent. 
Assumptions:
- ID Vault should be configured and installed.
- The Signer ID should have access to run XPages application and Password Reset Authority in ID Vault.
Application Architecture: 
wps_clip_image-21961
It consists of two NSF files: 
Front-End Application: The XPages frontend and the other one to store use profiles.
The first database contains configuration information to connect to second db. No other data is stored in it. It contains all the XPages design elements and is available for anonymous access use.
Back-End Data Storage Application: The second database contains all the registered user's profile documents. This database has no URL access and is only accessible by the front-end XPages interface. This approach avoids all URL based quirks to access data in NSF file. The user profile stores questions and secret answers as selected by user. The data is stored with MD5 hashing to ensure even administrators can't get access to user's personal information.
Application flow:
Step 1: Register your profile one time to select three questions from a admin defined list of questions. Provide easy to remember answers for the selected questions.
Step 2: If you have forgotten your password, then go to the application and proceed with password reset wizard. 
- It will ask first to verify email address 
- If the use profile is found for the entered email I'd, the application will prompt to provide answers for 3 questions. 
- If the answers match with the stored one in profile, user is allowed to provide new password. 
- The final screen provides confirmation message with results of password change process.
Installation Instructions:
- Download the application from project Download section and unzip on local machine. 
- Copy the two NSF files to your Domino Server’s Data Directory. 
- Sign the two databases with ID which has got rights to change password in ID Vault and can run XPages application on Server. 
- Open the resetpwd.nsf database in Notes Client and Modify the settings in Keywords view.
wps_clip_image-4648
n DATA_DB_PATH keyword specifies the path of ForgotPasswordData.nsf database. Please ensure a double “\\” to be added to path.
n The other settings specify the Domino Server names where ID Vault is located and where we would like to change the HTTP Password. 
n Few sample questions which can be easily customized in the QuestionList Keyword.
- Open the application resetpwd.nsf via Web Browser and check if it’s displaying the application HomePage. 
- Try to register a user’s profile and then try to reset the password for the same user. 
- The final screen will show status message of password change for HTTP and ID Vault. Fix the permission issues if any with ID Vault.
- Enable the Scheduled agent to Run on Server to UnBlock the profiles. This agent unlocks all such profile which were locked due to multiple failed attempts to reset the password. This is to avoid any person randomly trying to reset the password.
- Change Logos, Banner and Company Name in ccAppLayout Custom Control. 
wps_clip_image-14165


Let me know if any specific functionality is required to be added to the application.

Monday, 8 April 2013

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

In continuation to my first post: http://xpagesera.blogspot.in/2013/03/inotes-deployment-in-ha-mode-with.html

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"));

clustercookievalue:=@DbLookup("":"";@Subset(@DbName;1):"names.nsf";"($ServersLookup)";nodecookievalue;"clustername");

nodecookie:=@SetHTTPHeader("Set-Cookie";"inotesses="+@LowerCase(nodecookievalue));

@Success

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/mod_rewrite.so

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

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

<VirtualHost *:443>

ServerName webmail.demo.com

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 https://server01.demo.com:443/ route=server01 loadfactor=50

BalancerMember https://server03.demo.com:443/ route=server03 loadfactor=50

 BalancerMember https://server05.demo.com:443/ route=server03 loadfactor=1

ProxySet lbmethod=byrequests

</Proxy>

<Proxy balancer://Cluster2/>

BalancerMember https://server02.demo.com:443/ route=server02 loadfactor=50

BalancerMember https://server04.demo.com:443/ route=server04 loadfactor=50

 BalancerMember https://server06.demo.com:443/ route=server03 loadfactor=1

ProxySet lbmethod=byrequests

</Proxy>

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

ProxyPassReverse / https://server01.demo.com/

ProxyPassReverse / https://server03.demo.com/

 

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

ProxyPassReverse / https://server02.demo.com/

ProxyPassReverse / https://server04.demo.com/

 

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]

</VirtualHost>

 

Now, Stop & start httpd service.

Monday, 11 March 2013

iNotes Deployment in HA Mode with Multiple Clusters using Apache Reverse Proxy.


High Availability for Lotus iNotes Installation
I am looking for various options available for achieving High Availability with Lotus iNotes installation. The article outlines the options available, work that Domino experts have done and the best option that suits my requirement.
Following available options are possible:
1. ICM (Internet Cluster Manager): ICM only provides initial redirect to correct Domino Web Server. But once user has opened a webpage and server goes down, user has to manually switch the URL to point to the other server or browse the ICM URL again.
http://www-12.lotus.com/ldd/doc/domino_notes/Rnext/help6_admin.nsf/c1f2605b7be6a95985256b870069c0a8/36fd13678096637585256c1d0039a59b?OpenDocument
2. Hardware based Load Balancer
3. Software based Load Balancer: 
Following two options are possible with Domino: Websphere Edge Proxy Server and Apache Web Server. In this article, we'll use Apache Web Server for Reverse Proxy and Load Balancer configuration. 
Note: It seems like Daniel has already done all the hard work.. He has published a great series on the same topic !! The article is in Spanish, but can easily be translated in English via Google Translate. Please copy the code from Original version only.. 

I setup the following piece of code in httpd.conf: 

I setup two Domino Clusters as follows: 

Cluster1 - Server1, Server2

Cluster2 - Server3, Server4

 

<Proxy balancer://Cluster1/>

BalancerMember http://server1.demo.com:80/ route=Server1

BalancerMember http://server2.demo.com:80/ route=Server2

ProxySet lbmethod=byrequests

</Proxy>

 

<Proxy balancer://Cluster2/>

BalancerMember http://server3.demo.com:80/ route=Server3

BalancerMember http://server4.demo.com:80/ route=Server4

ProxySet lbmethod=byrequests

</Proxy>

 

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

ProxyPassReverse / http://server1.demo.com/ 

ProxyPassReverse / http://server2.demo.com/ 

 

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

ProxyPassReverse / http://server3.demo.com/ 

ProxyPassReverse / http://server4.demo.com/ 

 

RewriteCond %{HTTP_COOKIE} _clusterses=Cluster1 [NC]

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

 

RewriteCond %{HTTP_COOKIE} _clusterses=Cluster2 [NC]

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

Reference:

Monday, 7 January 2013

Lotus MailFile Template Modification: Prevent changes in received emails

 

In the default Lotus Notes Mail template, users can edit the received emails and modify the content. To prevent the same, following customization is required in template.
Edit "Memo" and "Reply" form in the designer                                

                                                                            
  change "QueryModeChange" event, by adding this code:                 
                 
  If  (Not source.editmode And source.document.HasItem("PostedDate"))   Then
       continue = False                                                         
       Exit Sub                                                                 
  End If                                                                    
                                                                            
Change "QueryOpen" event, and towards the top, add:                         
                                                                            
 If (Not (source.isnewdoc) And source.editmode ) Then        
     If (source.document.HasItem("PostedDate") ) Then           
          Continue = False                                          
          Exit Sub                                                  
     End If                                                     
 End If

Using Linux Desktop - My Favourite Add-ons

I am using RHEL 6 Desktop for last 6 months..


Following are the essential softwares required/installed on my machine to ensure my productivity:
1. Mail: Lotus Notes 9
2. Office Suite: IBM Lotus Symphony 3.1, Open Office 3.4.1
3. PDF Docs: Foxit Reader, Adobe Reader
4. Screenshots: Shutter
5. Notes, Customer Activity Tracking: GNote
6. Web Browser: Firefox, Chrome
7. Virtualization: VMWare Workstation, VMWare Player (Virtual Image: Domino Server, Domino Designer, Domino Administrator)
8. Backup to External Hard-drive: GrSync
9. Media Player: VLC Media Player
10. Remote Control: Teamviewer, Tiger VNC Viewer
11. Graphics: GIMP, Pencil


This list covers all the installations/additions I have done to Vanilla RHEL desktop... Apart from Domino Designer, there is nothing for which I need a Windows environment.. I wish if we can have a Linux version of Domino Designer as well some day !!