If your web server does not allow you to run CGI scripts outside of the 'cgi-bin' directory, you can enable CGI. Check with your system administrator or web hosting company before doing so.
To enable CGI, create a .htaccess file following the main instructions and guidance which includes the following text:
| AddHandler cgi-script .cgi
The above lines tell the Apache Web Server to allow firstly, process '.cgi' files as CGI scripts, and secondly to enable CGI within the directory.