I have done this more than a year ago, so I can’t remember the exact details.
However, try making the following changes to your /private/etc/apache2/httpd.conf and then restart the Apache server. (MAKE A COPY OF THE ORIGINAL FILE BEFORE YOU MODIFY)
This should be changed to whatever you set DocumentRoot to.
#ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) "/Library/WebServer/CGI-Executables/$1"
ScriptAlias /cgi-bin “/Users/[color=#FF0000][/color]/Sites/public/cgi-bin”
“/Library/WebServer/CGI-Executables” should be changed to whatever your ScriptAliased
CGI directory exists, if you have that configured.
Allow from all
Make sure that you replace [color=#FF0000][/color] with your user name on your machine; and put all your cgi executables in your cgi-bin directory.
But you should really read the Apache Server documentation.