ScriptAlias /cgi-bin/ "/real/path/to/cgi-bin/"
<Directory "/real/path/to/cgi-bin">
Note: Don't use the trailing slash for the container.
Put all your directories options and directives here.
</Directory>
As a rule, if your cgi scripts are more than one file, you would create a sub-directory inside cgi-bin. You do NOT have to redefine them because all directives defined in cgi-bin, apply to all its sub-directories. If you don't want to create a cgi-bin for some reason, you can use the "+ExecCGI" directive in the directory container where you want to use the script. You will also want to make sure there is an "AddHandler script-cgi .pl .cgi" directive and it is uncommented". This is usually define in the global section.