Question: where are cgi files 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.