Consegui resolver isso com:
$ sudo a2enmod cgi
dessa resposta link
Eu tenho alguns scripts CGI usando perl e gostaria de fazê-los funcionar no Apache. Eu tenho o seguinte instalado:
$ dpkg -l | grep perl | grep apach
ii libapache-session-perl 1.90-1 all modules for keeping persistent user data across HTTP requests
ii libapache2-authcookie-perl 3.19-3 all Perl Authentication and Authorization via cookies
ii libapache2-mod-perl2 2.0.8+httpd24-r1449661-6ubuntu1 i386 Integration of perl with the Apache2 web server
ii libapache2-mod-perl2-dev 2.0.8+httpd24-r1449661-6ubuntu1 all Integration of perl with the Apache2 web server - development files
ii libapache2-mod-perl2-doc 2.0.8+httpd24-r1449661-6ubuntu1 all Integration of perl with the Apache2 web server - documentation
ii libapache2-reload-perl 0.12-2 all module for reloading Perl modules when changed on disk
ii libapache2-request-perl 2.13-2.1 i386 generic Apache request library - Perl modules
ii libapache2-sitecontrol-perl 1.05-1 all perl web site authentication/authorization system
E em /etc/apache2/apache2.conf
eu adicionei algo assim:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory /usr/lib/cgi-bin/>
Options Indexes FollowSymLinks
Options +ExecCGI
#AllowOverride None
Require all granted
AddHandler cgi-script cgi pl
</Directory>
Depois disso, obtenho o conteúdo do script no navegador, em vez de executá-lo.
O script mencionado tem as seguintes permissões:
-rwxr-xr-x 1 root root 30146 mar 7 19:17 /usr/lib/cgi-bin/status.pl
Se eu colocar o seguinte link
$ ll /etc/apache2/mods-enabled/cgi.load
lrwxrwxrwx 1 root root 26 mar 7 21:40 /etc/apache2/mods-enabled/cgi.load -> ../mods-available/cgi.load
Então eu recebo o servidor de erros 500.