Print OAM/HTTP Headers on Oracle HTTP Server 11g (OHS)

22

Sep 2016

Print OAM/HTTP Headers on Oracle HTTP Server 11g (OHS)

Issue:

When troubleshooting Single Sign-On (SSO) issues or OAM SAML Assertion issues in OHS 11G, it is very useful to capture the HTTP Headers being passed to the web servers. By default OHS 11G servers have a perl script we can invoke to print the HTTP Headers.

 

Default URL:

http://hostname.domain:port/cgi-bin/printenv

 

When invoking the above page, we are getting HTTP/1.1 500 Internal Server Error

 

Root Cause:

 

The Operating System loaction/path of the Perl interrupter does not match the loaction/path of the Perl interrupter defined in the .pl script. The OHS 11g web server delivers out of the box /cgi-bin/printenv with the loaction/path of the Perl interrupter defined as:

 

#! /usr/local/bin/perl

 

Common Operating System locations/path of the Perl interrupter locations are below:

  • Linux/RHEL – #! /usr/bin/perl
  • Solaris – #! /usr/sfw/bin/perl
  • Windows – #!C:\Perl\bin\perl.exe

 

Resolution:

 

  1. Edit the printenv script (${ORACLE_INSTANCE}/config/${COMPONENT_TYPE}/${COMPONENT_NAME}/cgi-bin/printenv) and change the line indicating perl’s location from the default “usr/local/bin/perl” to the location where perl is actually located.
  2. cd $ORACLE_INSTANCE/config/OHS/ohs1/htdocs
  3. ln -s ../cgi-bin cgi-bin
  4. chmod 755 cgi-bin/printenv
  5. Restart the OHS Server and test it again

Below is a sample screen with HTTP Headers printed:

 

9-22-2016-9-27-37-am

Comments (1)

gaurav vajpeyi says:

Hey we are using F5 in front of OHS and OAM
On f5 we have i rule

when HTTP_REQUEST {
if {([matchclass [string tolower [HTTP::header User-Agent]] contains Search_bots])} {
HTTP::header insert X-OAM-AUTHN-HINT 0
}
}

Now we want to move from f5 and want to write this rule under OHS can you help

Post Your Thoughts

Your email address will not be published. Required fields are marked *