What are MINIMAL necessary reqirements to run Perl CGI scripts on Apache server?

0

I have my Apache showing perl scripts as plaint text, not executing them. Googling and playing with settings made me frustrating, because there are numerous and long samples, which are mostly ignored by my server.

The question is: what are absolutely necessary minimal requirements to run Perl CGI scripts on my web site?

Please no security issues, no other issues, only running Perl.

Currently I have Apache2 installed, mod_perl installed, perl installed, virtual hosts installed, execution permission granted.

And I have index.cgi is displayed as plain text.

The following is my size config:

enter image description here

One special question is: why AddHandler directive is silently ignored twice? If it was explicitly said, that .cgi files should be handled by cgi-script, then how this can be silently ignored (no any warning in logs).

From my point of view, any directive should be either executed or caused an error. It can't just hang in the air as if it was no any directive at all.

UPDATE

The files are Bugzilla installation. I.e. there are plenty of *.cgi files with perl code inside.

Suzan Cioc

Posted 2014-12-18T18:07:13.730

Reputation: 2 103

Is the generated HTML code shown as plain text or the perl code? Did you really mean *.GCI or did you mean *.cgi? – Axel Beckert – 2014-12-18T19:03:32.137

Perl code is displayed. I meant lowercase. – Suzan Cioc – 2014-12-18T19:20:04.330

And I guess you also meant *.cgi instead of *.gci. (Now lowercase so the second difference can be spotted more easily, too.) Hrm. – Axel Beckert – 2014-12-18T19:48:59.420

Answers

0

mod_perl isn't necessary to run Perl CGI scripts in Apache. (But it may speed up some of them.)

What may be missing but isn't clear due to the rather incomplete configuration shown above, is, if mod_cgid or mod_cgi are loaded. In Apache 2.2, it depends on the MPM which of those two you have to use.

If you're on Debian or Ubuntu, calling a2enmod cgi or a2enmod cgid plus a service apache2 restart may already suffice to solve your issue. Not sure if these helper scripts are available on other distributions, too.

Axel Beckert

Posted 2014-12-18T18:07:13.730

Reputation: 514