Where should CGI scripts be placed?

It doesn't matter where you place your CGI scripts within your website. For clarity, most people put them in the cgi or cgi-bin folder.

Do you want the webserver to recognize your scripts as CGI scripts? Then make sure they have the .pl or .cgi extension. Only then will they be processed by the CGI module.

Give your CGI script the permissions 750 (rwxr-x---).

Related articles