Usually, it's in /var/log, the directory will be called 'httpd', not 'apache'. So check the /var/log/httpd directory.
If it's still not there, find the file called 'httpd.conf' (you may be able to use the locate command to find it. 'locate httpd.conf'), and grep for 'ErrorLog' and 'CustomLog'. These should tell you what directory the logs are placed in.
But as mentioned above, the script, as written, is not meant to be a CGI script, but rather, a command line script. You'll need to add the aforementioned headers, plus possibly some other code, to get it to run as a CGI process.
--Chris
e-mail jcwren