You have to configure apache through the /etc/httpd/httpd.conf file to run cgi scripts in different directories - although /var/www/cgi-bin will more than likely be set-up to run them to start with. Place the file in there.
To view the script, type in a browser:
Make sure that the file is set-up to execute to global permissions - i.e. try:
chmod 755 cgifilename.cgi
what was the error you received already? You can always take a look at the apache logs in /var/log/httpd for errors.