Perl .pl file downloads instead of being executed
Solution 1
Make sure you have set the following path in your /etc/apache2/apache2.conf
:
ScriptAlias /cgi-bin/ "/path/to/cgi-bin/"
and that your scripts are in that folder.
If your scripts ends on .pl make sure to change the line
AddHandler cgi-script .cgi
to AddHandler cgi-script .cgi .pl
in /etc/apache2/apache2.conf
and check that it is not commented out.
Options FollowSymLinks +ExecCGI
needs to set in your virtual host.
Solution 2
Waking the dead but with the answer. Do this:
ln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/
ln -s /etc/apache2/mods-available/cgid.conf /etc/apache2/mods-enabled/
sudo service apache2 restart
and it works.
Related videos on Youtube
SPRBRN
Updated on September 18, 2022Comments
-
SPRBRN over 1 year
I'm trying to get OTRS 4.0 working on Ubuntu 14.04. I've followed all instructions to install from source.
When I open the site (localhost/otrs/index.pl), an empty .pl-file is served for download. Apparently Apache finds the index.pl, but does not know what to do with it.
- OTRS is installed with all relevant perl modules (checked by install script)
- Vhost is copied from scripts folder in OTRS
- hosts is updated for the local test domain
- Apache is restarted
Modules
cgi.load -> ../mods-available/cgi.load perl.load -> ../mods-available/perl.load
Question
How can I get Perl working with Apache?
-
SPRBRN about 9 yearsThanks for the reply! There was no AddHandler in apache2.conf. I've added it. There was no ScriptAlias either. OTRS has its own ScriptAlias for cgi-bin:
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
. So this alias should point to the OTRS cgi-bin? Adding the cgi-bin ScriptAlias doesn't change anything after a restart. -
Pabi about 9 yearsI just had a chance to take a more detailed look at OTRS. All necessary config is allready provided in the
/opt/otrs/scripts/apache2-httpd.include.conf
. Have you copied that file to your/etc/apache2/conf-available
directory and enabled it witha2ensite apache2-httpd.include
? -
App almost 8 yearsOr
a2enmod cgid