Getting CGI enabled in apache2 is trickier that you might expect.  There  are
lots  of descriptions of how to set up and enable the cgi-bin directory.  But
there's little mention of how to make CGI work in users' web directories.

Basically, you have to go through all the .conf files, look for all uses of 
Options, and add ExecCGI (or +ExecCGI) to the list.


One important thing that's missed in most of the online discussions of CGI is
how to actually make sure that the cgi module is enabled:

   sudo a2enmod cgi

This is what I've finally makes it work instead of displaying the CGI  script
as plain text in the user's browser window.