2

I have installed ubunutu witha apache on my pc and everything works great except: I don't know how to enable perl, everything I have tried either gave me a server error or gave me a 403 for the perl scripts.

Please tell me how to enable Perl. Thanks!

  • This is a web server configuration issue, and is addressed in the documentation for Apache. – DavidO Jul 25 '12 at 01:57

2 Answers2

1

Place your files in /usr/lib/cgi-bin, make them executable and change the owner and group to www-data:

sudo cp myscript.pl /usr/lib/cgi-bin/
sudo chown www-data.www-data /usr/lib/cgi-bin/myscript.pl
sudo chmod 0755 /usr/lib/cgi-bin/myscript.pl

I prefer to enable the "AddHandler cgi-script .cgi" line in /etc/apache2/mods-available/mime.conf by removing the "#" in front of it and setting "Options +ExecCGI" for the directories below /var/www where scripts should be executed. But beware: Everything executable ending with ".cgi" will be executed as a cgi script this way.

Sebastian
  • 2,472
  • 1
  • 18
  • 31
0

The issue is likely not a problem with Perl. Rather, your Apache2 installation may not be configured to parse .pl or .cgi files. You should review the Apache Web Server documentation as well as this SO article.

Community
  • 1
  • 1
Radix
  • 667
  • 5
  • 28
  • Where would I have to edit my configuration, I mean I don't want to read the entire documentation to get the answer to one simple thing? I appreciate you helping me out but it would make it a bit easier if you told me what some of the possible things I would have to check for. –  Jul 25 '12 at 03:09
  • I made my answer generic because troubleshooting your issue with the amount of information provided was sheer conjecture. Sebastian gives you the next level of what you should try. – Radix Jul 25 '12 at 12:50