Disclosure: I searched a lot, and I don\'t think my question (for my configuration) is answered here. For example run python script as cgi apache server doesn\'t answer it.
I was having the same problem and tried all of the above. Nothing helped. In the end it turned out to be a really stupid mistake. Since many people seem to have problems with this, I will post it anyway:
I had not sym-linked my default site from "sites-available" to "sites-enabled" as described at the top of the apache.conf file:
[...] Configuration files in the mods-enabled/ and sites-enabled/ directories contain particular configuration snippets which manage modules or virtual host configurations, respectively.
They are activated by symlinking available configuration files from their respective *-available/ counterparts. These should be managed by using our helpers a2enmod/a2dismod, a2ensite/a2dissite. See their respective man pages for detailed information. [...]
Thus, all my edits to the default file were not read by apache. Once I made the symlink, it worked.