OpenSpace has asked for the wisdom of the Perl Monks concerning the following question:

Hi

I have installed perl 5.20.3 using perlbrew on a Centos 7 machine. The new version of Perl sits in a user account at /home/grunt103/perl5/perlbrew/perls/perl-5.20.3/bin/perl

I can run a hello world script in the Apache cgi-bin (./var/www/cgi-bin/hello_brew.pl) from the command line without any issues. The version command $^X in the script shows it is using perl 5.20.3

I can also run a hello world script from the command line using the default instal at /usr/bin/perl

However if I try to run the scripts through the browser (271.0.0.1/cgi-bin/) the script using the default instal works fine, but the script using the 5.20.3 instal gives a server 500 error and the following entries in the apache error log;

[error] [client 127.0.0.1] (13) Permission denied: exec of '/var/www/c +gi-bin/perl_brew.pl' failed [error] [client 127.0.0.1] Premature end of script headers:

I get the same result for both root user and the grunt103 user.

I have tried issuing the command 'perlbrew use perl-5.20.3' before running the script but to no avail.

I have disabled selinux but this has made no difference.

I have tried a variety of permissions, owners, groups, setuid and setgid settings but none have worked.

Can any body advise on how I might gain access to the new perl version via localhost?

Thanks

Replies are listed 'Best First'.
Re: localhost cannot access new perl version
by hippo (Archbishop) on Jun 13, 2016 at 12:54 UTC

    It is highly likely that ~grunt103 has permissions 0700 which would preclude the apache process owner from reading farther down that tree. Add global execute permission to ~grunt103 and any subdirs which don't have it. Assuming that solves the problem you can consider tightening things further by using the apache group instead of global.

    I have disabled selinux but this has made no difference.

    It's a handy diagnostic change but you should re-enable it again now. Just check the audit log to see if SELinux is preventing access.

      Thanks Hippo, This cured the problem

      I am kicking myself for not seeing this myself!

      I shall go and meditate :)