Question: where are cgi scripts stored?
Answer: You should upload CGI scripts to cgi-bin folder that is located under htdocs. Files that are located in cgi-bin folder are recognized by web-server as CGI programs and run from the shell.