Looks like where you put the script is not where your web server searches for it. Typically, the cgi-bin directory is not under the document root (webpage), but in a different hierarchy. Check your apache configuration file and search for cgi-bin to figure out the real cgi directory.