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

1 comment:

  1. After I make the changes in https.conf, I cannot start the IBM HTTP Server.

    ReplyDelete