CGI script is returning raw text instead of getting processes

I am not a CGI/Unix expert. I was installing Cognos and as part of it we have the gateway which uses the cgi-bin
The application was working fine untill the server is recreated with taking backup from the old server. so for testing I created a sample cgi file as test.cgi created at \opt\unica\cognos\chi-bin\ location .

I am calling the cgi file as

servername/ibmcognos/cgi-bin/test.cgi

And the result instead of being a html output is actually coming as the content of the test.cgi (email attached if not coming below)

here is the configuration of httpd.conf file

ScriptAlias /ibmcognos/cgi-bin "/opt/unica/cognos/cgi-bin"
<Directory "/opt/unica/cognos/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
</Directory>

Your config looks pretty good to me... Are you certain that it's actually reading that scriptalias? Check by first trying to go to /ibmcognos/cgi-bin-foo/test.cgi (should get a 404) then update the alias to match and try again.

Also make sure you've got the cgi module loaded ( LoadModule / AddModule cgi_module )