29 April 2010

Oracle Fusion Middleware 11g: Missing ShortHostnameRedirect.pm

The Perl module ShortHostnameRedirect.pm was conveniently included with Oracle Application Server 10g to enable the Oracle HTTP Server to rewrite a short-form URL (host name only) to an FQDN using Apache::ShortHostnameRedirect, which is required in order for Single Sign-On to function properly. After all, the registered Oracle Single Sign-On sites are provided with an FQDN.

However, it would seem that the module is missing in 11g - and I have filed a service request with Oracle and they have in turn logged bug number 9509415 with development to resolve this.

In the meantime I have manged to put together a workaround using mod_rewrite. Simply add the following configuration to your Oracle HTTP Server configuration:

RewriteEngine On
RewriteCond %{HTTP_HOST} !mysite.mydomain.com
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R]

Where mysite.mydomain.com is the fully qualified domain name.

I have noticed no noticable side effects pertaining to Oracle Single Sign-On.

If there are multiple name-based virtual hosts in your configuration you may have to alter this slightly to check whether the HTTP_HOST is a short-form, for each host name you host; and if so, rewrite to FQDN.

No comments: