in reply to configuring apache to automatically send Content-Type header and exec as CGI based on file extension
In your httpd.conf:
AddHandler cgi-script .cgi AddType text/html .cgi DefaultType text/html [download]
-Blake