Before we begin, I want to say that I have read this: Perl Apache : Perl script displayed as plain text
I've read it, tried the things, didn't work out (Sadly)
I am on Ubuntu
I want to run cgi scripts, they compile fine, I have the appropriate rights to the folder (atleast I don't get an error that I don't when I try to enter it through the browser)and the files run as plain text.
First the file which I am trying to run:
#!/usr/bin/perl
use CGI qw/:standard/;
print header,
h1('CGI.pm is simple.'),
end_html;
And I get as output the source code.
The path to the folder is /var/www/a2/
and the configuration in the apache .config file is:
ScriptAlias /a2/ /var/www/a2/
<Directory "/var/www/a2">
AddHandler cgi-script .cgi .pl
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
The file compiles fine and prints the html in the terminal.
My only guess is that I have not given proper rights to the file.
EDIT: I checked the error log. It doesn't give an error for this.
EDIT: After a very long discussion with Mark Setchell the error was discovered. I had posted this in the wrong .config file and I had been using the wrong (unconfigured folder) all along.