Dave Howorth has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use perlbrew with apache and my head hurts!
I have a machine where I don't want to use the system perl with my applications, so I've installed perlbrew. It works fine for me, and it works fine for another user sharing my installation, but I can't figure out how to make it work for apache CGI scripts.
I know this is a question that's been asked lots of times in various places, because google tells me so. But I haven't found any articles that answer all my questions.
The first stumbling block of course is that apache doesn't have a login account, so can't setup perlbrew in the normal way. So the common wisdom appears to be to use the shebang line in the CGI scripts to hardwire a particular perlbrew perl. So OK, it feels a bit clunky because I have to modify every script every time I change perls, but hey. So I do that and discover that now it can't find the modules so I add a bunch of use lib statements to the scripts as well.
That gets the script running, but all the script does is massage its arguments and 'system' an actual application program. So I add another hack that discovers the perl running the script and adds that to the 'system' call that runs the application. And after doing some tweaking to satisfy taint, that works too. But I have a nagging worry about which libraries it's using and it all feels kludgy.
Except that the application program in turn executes various other applications in some circumstances, so before I can investigate my library doubts I'm faced with yet another case of the wrong perl.
Now sure I could edit my application and however many other applications until it all works, but there's really got to be a better way! It feels like I'm falling down the rabbit hole. So I thought before I dive off and explore all kinds of wacky possibilities, I'd supplicate myself at the gates of the monastery and ask pretty please if anybody already knows a good way to do this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using perlbrew with apache
by ikegami (Patriarch) on Feb 12, 2016 at 16:51 UTC | |
by Dave Howorth (Scribe) on Feb 15, 2016 at 16:28 UTC | |
|
Re: using perlbrew with apache
by 1nickt (Canon) on Feb 12, 2016 at 17:07 UTC | |
by Dave Howorth (Scribe) on Feb 15, 2016 at 16:30 UTC |