Wednesday, August 22, 2012

Lotus Connections / IBM HTTP Server (Apache) root directory redirect to application

When configuring Lotus Connections to use IBM HTTP server, it's always annoyed me that when typing in the URL minus an application, it takes me to an IBM HTTP server help screen. I've configured a redirect in Lotus Connections 2.5, however, I was unable to find my documentation. There are a few ways to accomplish this but I'm going to cover the one that works best for me. ( might not be the best solution for you ) So this post is how to configure a URL redirect / rewrite from the root / to an application ( /homepage ) in Lotus Connections using IBM HTTP server.

1. First, locate your httpd.conf file the IBM HTTP Server is using. to load the module for redirect / rewrite, locate the line that says 

#LoadModule rewrite_module modules/mod_rewrite.so

and remove the # to uncomment

LoadModule rewrite_module modules/mod_rewrite.so

2. Next, locate the line that says DocumentRoot


and place a # in front of the line to comment it out.


3. Next locate the VirtualHost *:443
FYI,  blogger.com won't let me post the correct syntax for the VirtualHost *:443, please see the image below for the correct syntax
VirtualHost *:443
Servername lc.ozzyblogger.com
SSLEnable
/VirtualHost


and add two lines

VirtualHost *:443
Servername lc.ozzyblogger.com
SSLEnable
RewriteEngine on
RewriteRule ^/$ /homepage [R,L]
/VirtualHost

This will load the lc.theozzyblogger.com/homepage application when you type lc.ozzyblogger.com/ in the url  btw lc.theozzyblogger.com is not a real website, just an example :)

Note:

^ is the beginning of the line 
$ is the end of the line 
. is any single character except new line 
* is zero or more of character

4. Last, create a virtualhost entry for all port 80 requests to redirect to SSL at the end of the file

FYI, blogger.com won't let me post the correct syntax for the VirtualHost *:80, please see the image below for the correct syntax
VirtualHost *:80
RewriteEngine on
RewriteRule ^/$ /homepage [R,L]
# handy for seeing what's going on when the web server tries to redirect
#RewriteLog "C:/rwlog.txt"
#RewriteLogLevel 1
# if the port's not 443 (ssl)...
RewriteCond %{SERVER_PORT} !^443$
#...redirect it to the same page but make it SSL
RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
/VirtualHost


That will take care of any requests that are typed as http://lc.theozzyblogger.com and redirect / rewrite as https://lc.theozzyblogger.com/homepage


Here are the web pages used as reference:


Configuring the IBM HTTP Server for SSL
http://publib.boulder.ibm.com/infocenter/ltscnnct/v2r0/index.jsp?topic=/com.ibm.lc_2.0_IC/t_configure_ihs.html 
Redirecting non-SSL (HTTP) requests to SSL (HTTPS) requests with IBM HTTP Server or Apache, and WebSphere Application Server
http://www-01.ibm.com/support/docview.wss?uid=swg21107738

Wednesday, August 1, 2012

Difference between LOG_SESSION and LOG_DISABLE_SESSION_INFO

I ran across an issue with log.nsf file growing quite large. To help reduce the size of the log file I started looking at how to remove the following session information:

Open session for Test User1/Domain (Release 8.5.3)
Closed session for Test User1/Domain Databases accessed:   1  Documents read:   1   Documents written:   0

from the log.nsf miscellaneous events. I found two notes.ini parameters, LOG_SESSIONS and LOG_DISABLE_SESSION_INFO. They both do the same thing, but what is the difference? After firing up a test environment, LOG_DISABLE_SESSION_INFO=1 disables open session / closed session events on the console, and therefore the miscellaneous events. This parameter also disables usage details in the log.nsf ( views named Usage / by Date, Usage / by User, Usage / by Database, Usage / by Size will be empty).

LOG_SESSIONS=0 disables the open session / closed session events on the console, and therefore the miscellaneous events. However, the usage details are recorded in the log.nsf ( views named Usage / by Date, Usage / by User, Usage / by Database, Usage / by Size will not be empty). Hope this helps someone out there :)