We have a server running Centos 5.11, Apache 2.2 and default perl. Running scripts through suexec is working "just fine", but I have installed perlbrew so that I can install a load of extra modules without interferring with it.
I have created a simple perl script to test:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "perl: ". $^X . "\n";
When run through apache+suexec, it outputs, as expected:
Hello, world! perl: /usr/bin/perl
But, when I change the shebang line to:
#!/root/perl5/perlbrew/perls/perl-5.22.1/bin/perl
and run the same way, I get an internal server error, and the apache error log shows:
suexec failure: could not open log file
fopen: Permission denied
Premature end of script headers: test.cgi
but running at the command line is fine:
# ./test.cgi
Content-type: text/html
Hello, world!
perl: /root/perl5/perlbrew/perls/perl-5.22.1/bin/perl
I've tried all sorts of things. I did wonder if it's a "PATH" issue, but apache docs say "On 2.2, the PATH environment variable cannot be set using Setenv."
The suexec errors usually seem to be caused by dos/unix encoding - but that's not an issue here.
Might it be an issue with the way I've installed perlbrew? Should it be as a different user (as apache)? different location (under /var/www)?
Any other suggestions welcomed!