I spent a few days searching for answers on serverfault and elsewhere, and tried them all to no avail. I'm trying to serve dynamic content using perl cgi scripts (Apache 2.4.29 on Ubuntu 18.04.2). The perl scripts are served to the browser as plaintext instead of being executed and their results served.
My VirtualHost file looks like this:
ServerAdmin webmaster@localhost
DocumentRoot /data/www/html/tesserae-obvil
<Directory /data/www/html/tesserae-obvil/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /data/www/html/tesserae-obvil/cgi-bin/
<Directory "/data/www/html/tesserae-obvil/cgi-bin/">
Options +ExecCGI +Indexes +MultiViews
Options FollowSymLinks
SetHandler cgi-script
Require all granted
</Directory>
ErrorLog /data/www/log/error.log
CustomLog /data/www/log/access.log combined
</VirtualHost>
I have enabled the cgi module with sudo a2enmod cgi
, installed perl for Apache with sudo apt-get install libapache2-mod-perl2
and restarted Apache. Right now my best working theory is that Apache2 is not loading Perl properly. I found some instructions on setting up CGI, but even though they are supposed to be for the current version, they mention adding a LoadModule line to httpd.conf, which I gather is depreciated.
I have run out of ideas. Can anybody help?