How To Display Header Variables With Plain Apache Web Site.

Blog Post created by Rick_Siek Employee on Dec 11, 2017

If you need to be able to display in your web browser the header variables created by CA SSO, or any other source, and can't use an ASP or JSP page because the site you are working with only has a plain Apache web server installation, you can do it with a perl cgi script. I have attached a perl script to this blog entry that will dump all the headers to a web page.

If you are using the default RedHat Linux installation of Apache, the script needs to be placed in the directory /var/www/cgi-bin. Make sure that the www directory and everything under it is owned by apache:apache. When logged in as root you can use the command chown -R /var/www to accomplish this. Also make sure that the permissions on envtesttable.pl allow execution. The command chmod 550 will set the correct permissions.

You may need to edit the envtesttable.pl file and change the first line to specify the correct location of the perl interpreter on the machine, if it its location isn't: /usr/local/bin/perl. Most recently I had to change the location to /usr/bin/perl.

You access the perl cgi-script via the URI /cgi-bin/envtesttable.pl

You may also want to change the file name to something easier to remember, like dumpheaders.pl.

I didn't write and name the perl script. I got it from Mark Hall years ago, and I don't know whether or not he wrote it or got if from someone else in the tech support group at the time.