Following setup: IHS Webserver with Dispatcher module configured which in turn points to a Websphere app-server render farm where a CQ instance is running. A class or jsp script in CQ calls the response.sendRedirect()
method which results in a wrong redirect: the internal server name and port of the Websphere app-server which is not reachible from the outside is exposed in the Location
response header which is used to do the actual redirect.
The root cause of this problem is Websphere itself as IBM's implementation of the HttpServletResponse#sendRedirect()
method is directly influenced by custom request headers, per default generated by Websphere's IHS plugin. This is considered as an IBM vendor lock-in issue.
Using mod_headers
in the IHS webserver it is possible to pass Websphere specific headers to the app-server by adding such headers with the RequestHeader
directive. In addition to that, these custom headers need to be explicitely allowed in the Dispatcher configuration, otherwise these custom headers will be ignored.
Example:
Edit the httpd.conf
configuration file of the IHS webserver and do the following:
mod_headers
is present and loadedRequestHeader
directiveExample (excerpt from httpd.conf
):
... LoadModule headers_module modules/mod_headers.so ... <Directory /> <IfModule disp_apache2.c> # set custom Websphere headers RequestHeader set $WSSN www.mydomain.com RequestHeader set $WSSP 80 SetHandler dispatcher-handler </IfModule> Options FollowSymLinks </Directory>
Dispatcher configuration
On Dispatcher level, it is required to add the list of above configured request headers to the list of client headers that the Dispatcher will forward to the defined render farm, Websphere app-server in this case.
Please do the following:
dispatcher.any
configuration file/clientheaders
and add additional headers to be includedExample (excerpt from dispatcher.any
):
... /clientheaders { ... "$WSSN" "$WSSP" } ...
Websphere configuration
The $WSSP
Websphere header specifies the port and $WSSN
defines the hostname to be used when response.sendRedirect()
is called in Websphere. In addition to that, the port provided in the $WSSP
header is also used to map the virtual host in Websphere.
Connect to the Administration Console of Websphere and do the following:
Environment > Virtual Hosts
Host Aliases
80
NOTE: it might be required to add more Websphere specific headers, depending on the setup. Please refer to this document describing Websphere specific headers and their meaning.
下载
登录到您的帐户