CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Recompile Perl Module for Apache

 



hpg4815
Novice

May 6, 2016, 1:57 PM

Post #1 of 5 (1805 views)
Recompile Perl Module for Apache Can't Post

Outside of perlbrew. Can I install a separate Perl version in a different location and simply compile a new mod_perl module against that new installation of perl? Not touching the already installed Apache. Basically what I am trying to digest... is it required to recompile Apache in order to create a new mod_perl.so module that is complied to use the alternate installation of Perl?

Steps i'm wondering if will work...
1. download compile separate version of perl in a location outside of that which came with OS.
2. build a new perl module (complie) against newly complied Perl in alternate location.
3. copy new mod_perl.so file into Apache /etc/httpd/modules location and restart apache.
4. use Apaches perl_status directive to witness the perl version and alternate location.

Will that work? Not tocuing Apache other than a restart.


FishMonger
Veteran / Moderator

May 6, 2016, 2:59 PM

Post #2 of 5 (1802 views)
Re: [hpg4815] Recompile Perl Module for Apache [In reply to] Can't Post


Quote
Outside of perlbrew.

My first question would be why not do it inside perlbrew?

It's been a long time since I built mod_perl but your steps sound right if you want a static build. If you want a dynamic build, you'll need to make sure you have the loadmodule directive in httpd.conf and possibly some other directives.


https://perl.apache.org/docs/2.0/user/index.html


(This post was edited by FishMonger on May 6, 2016, 3:00 PM)


hpg4815
Novice

May 6, 2016, 6:12 PM

Post #3 of 5 (1796 views)
Re: [FishMonger] Recompile Perl Module for Apache [In reply to] Can't Post

Some of the other documentation i found insinuated that building mod_perl was difficult. I did try it and it wasn't going all that smoothly.

I only want to use are dynamically modules. I just don't want to have to touch the Apache already installed. Touch meaning having to recompile it in conjunction with Perl and Mod_Perl. So just to clarify, I can do this? Build & compile Perl in a custom location, update the make file for mod_perl src rpm to point to that custom Perl install, build the module and just copy it place so Apache can read it with the loadmodule directive?

if yes, do i still need to adjust all my calls to the Perl binary to point to the perl in the custom location?


hpg4815
Novice

May 6, 2016, 6:31 PM

Post #4 of 5 (1794 views)
Re: [hpg4815] Recompile Perl Module for Apache [In reply to] Can't Post

I would also like to ask, if I use perlbrew it compiles and installs the perl version. It doesn't offer the source so how would I be able to build the mod_perl for that installation of perl. Unless you are saying that I wouldn't need to. Do I just define the custom perl location and the already install apache location in the make file and then build the mod_perl module? then I can move that module where ever I want?


FishMonger
Veteran / Moderator

May 7, 2016, 8:34 AM

Post #5 of 5 (1780 views)
Re: [hpg4815] Recompile Perl Module for Apache [In reply to] Can't Post


Quote
can I do this? Build & compile Perl in a custom location, update the make file for mod_perl src rpm to point to that custom Perl install, build the module and just copy it place so Apache can read it with the loadmodule directive?

Yes, that should work.


Quote
if yes, do i still need to adjust all my calls to the Perl binary to point to the perl in the custom location?

If you're referring to CGI scripts and not scripts running under mod_perl, then yes, the shebang line needs to point to the location of the perl version you want to use and you'll probably need to configure a virtual host section as well. When running under mod_perl, I don't think you need to have a shebang line, but I could be mistaken.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives