If you have a webform that is posting to a CGI, the setup is the same whether the access is local or from the internet. First make sure your CGI script is executable
Code:
chmod a+x myfile.cgi
and that the directory it is in has the +ExecCGI attribute, then add a handler for your specific CGI file extension (assuming this is for Apache):
Code:
<Directory "/var/www/mysite">
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>
You can also use a ScriptAlias, you can find more info on this here:
http://httpd.apache.org/docs/2.2/howto/cgi.html