You want each user to have their own cgi-bin directory rather than giving them all access to the main server CGI directory.
Put this in your httpd.conf:
<Directory /home/*/public_html/cgi-bin/> Options ExecCGI SetHandler cgi-script </Directory>
You can't use ScriptAlias in this case, because for each user, the first argument to ScriptAlias would be different. Using ScriptAliasMatch would also be impossible. The second argument to ScriptAliasMatch must be a constant string.
This recipe lets each user put CGI scripts in her own personal web space. Files accessed via URLs starting with:
are treated as CGI scripts.
If you have suexec enabled, CGI programs run from this target directory will be run with the userid of the user specified in the URL. For example, a CGI program accessed via the URL http://www.example.com/~rbowen/cgi-bin/example.cgi would be run as the user rbowen.