Enable
cgi-bin script folder by creating file /etc/apache2/conf.d/cgi-bin.conf:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Put the following file in
/usr/lib/cgi-bin/