Installing mod_perl for 2 versions of Perl?

Installing mod_perl for 2 versions of Perl?

am 11.07.2011 09:13:25 von Octavian Rasnita

This is a multi-part message in MIME format.

------=_NextPart_000_00CA_01CC3FB3.2BF082A0
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

Hi,

Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions of =
Perl for the same Apache?

I have the default build of Apache that comes with Ubuntu and the =
default Perl that comes with Ubuntu and I also have the mod_perl =
installed with apt-get.

I want to test ActivePerl 5.14 and I want to install Mod_perl for it but =
I wouldn't like to need uninstalling the actual Apache/Perl/mod_perl.

Thanks.

--Octavian

------=_NextPart_000_00CA_01CC3FB3.2BF082A0
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable



charset=3Diso-8859-2">




Hi,

 

Under Ubuntu 10.04, is it possible to =
install=20
mod_perl for 2 versions of Perl for the same Apache?

 

I have the default build of Apache that =
comes with=20
Ubuntu and the default Perl that comes with Ubuntu and I also have the =
mod_perl=20
installed with apt-get.

 

I want to test ActivePerl 5.14 and I =
want to=20
install Mod_perl for it but I wouldn't like to need uninstalling the =
actual=20
Apache/Perl/mod_perl.

 

Thanks.

 

size=3D2>--Octavian


------=_NextPart_000_00CA_01CC3FB3.2BF082A0--

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 09:48:54 von aw

Octavian Rasnita wrote:
> Hi,
>
> Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions of Perl for the same Apache?
>
> I have the default build of Apache that comes with Ubuntu and the default Perl that comes with Ubuntu and I also have the mod_perl installed with apt-get.
>
> I want to test ActivePerl 5.14 and I want to install Mod_perl for it but I wouldn't like to need uninstalling the actual Apache/Perl/mod_perl.
>

In my opinion, the short practical answer is no.

It is technically possible, but you are going to spend so much time trying to combine this
properly, that it is probably not worth the effort.
You would save yourself a lot of time by using another host, installing your chosen
versions of Apache and Perl on it, and then installing mod_perl from source, pointing it
to the installed Apache and Perl.

Personal opinion, all of it. YMMV.

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 11:38:37 von torsten.foertsch

On Monday, July 11, 2011 09:13:25 Octavian Rasnita wrote:
> I want to test ActivePerl 5.14 and I want to install Mod_perl for it
> but I wouldn't like to need uninstalling the actual
> Apache/Perl/mod_perl.

Don't you have separate module libraries?

Anyway, you always can use the DESTDIR=3D... option:

make DESTDIR=3D/some/where install

This takes /some/where as root directory.

You then have to use PerlSwitches -I... or similar in the httpd.conf. You=20
also have to modify the LoadModule statement to load the right modperl.

If you want to compile additional modules make sure they use the right=20
header files and also use the DESTDIR option.

Torsten Förtsch

=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 12:17:43 von aw

Torsten Förtsch wrote:
> On Monday, July 11, 2011 09:13:25 Octavian Rasnita wrote:
>> I want to test ActivePerl 5.14 and I want to install Mod_perl for it
>> but I wouldn't like to need uninstalling the actual
>> Apache/Perl/mod_perl.
>
> Don't you have separate module libraries?
>
> Anyway, you always can use the DESTDIR=... option:
>
> make DESTDIR=/some/where install
>
> This takes /some/where as root directory.
>
> You then have to use PerlSwitches -I... or similar in the httpd.conf. You
> also have to modify the LoadModule statement to load the right modperl.
>
> If you want to compile additional modules make sure they use the right
> header files and also use the DESTDIR option.
>
By personal experience, I believe that this is over-simplifying a bit.
Ubuntu/Debian packages are nice, and they "just work".
But these packages work by putting (very clever) links all over the place, and I wish good
luck to someone wanting to combine this with, for example, another perl and a mod_perl
installed from source, while keeping the same Apache.
(E.g. if it needs changing the LoadModule line in Apache, then of course you cannot run
this concurrently with the normal version.)
And trying to install a CPAN package over that, to a directory library that is not the
default one, is a real pain. At least the last time I tried.

Admittedly, I am not the ultimate perl/mod_perl expert, and in the end I will defer to the
real experts. But I believe that the OP is not a real expert either, and for now I'll
stick to my earlier recommendation.

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 19:44:33 von Perrin Harkins

2011/7/11 Octavian Rasnita :
> Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions of
> Perl for the same Apache?

Just install another apache. It's pretty simple to compile apache and
mod_perl against your own perl, and it avoids needing to put a bunch
of custom stuff in your httpd.conf to specify library paths, etc.

- Perrin

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 19:46:31 von Fred Moyer

On Mon, Jul 11, 2011 at 10:44 AM, Perrin Harkins wrote:
> 2011/7/11 Octavian Rasnita :
>> Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions of
>> Perl for the same Apache?
>
> Just install another apache. =A0It's pretty simple to compile apache and
> mod_perl against your own perl, and it avoids needing to put a bunch
> of custom stuff in your httpd.conf to specify library paths, etc.

But you will likely want to compile Apache with the
--with-included-apr so that it uses the included apr libraries and not
those provided by Ubuntu.

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 21:14:59 von Octavian Rasnita

From: "Perrin Harkins"

> 2011/7/11 Octavian Rasnita :
>> Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions =
of
>> Perl for the same Apache?
>=20
> Just install another apache. It's pretty simple to compile apache and
> mod_perl against your own perl, and it avoids needing to put a bunch
> of custom stuff in your httpd.conf to specify library paths, etc.
>=20
> - Perrin



Mmm, I like the word "simple" :-)

I am still afraid to compile Perl+Apache+mod_perl since the old days =
when I needed to do that because there were no other solutions, and when =
I needed to face some ugly compiling errors...

But if you say that it is simple, I will try it.

....because my current solution is not less uglier. I have installed =
Apache using apt-get, multiplied it to have 3 instances of Apache, with =
their own services and settings in /etc and due to the way Apache is =
installed under Ubuntu it was not very funny.
(Because I needed to test an Apache-proxy and 2 Apache back-ends with =
mod_perl on the same machine...

Thanks.

Octavian

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 21:16:14 von Octavian Rasnita

From: "Fred Moyer"

On Mon, Jul 11, 2011 at 10:44 AM, Perrin Harkins =
wrote:
> 2011/7/11 Octavian Rasnita :
>> Under Ubuntu 10.04, is it possible to install mod_perl for 2 versions =
of
>> Perl for the same Apache?
>
> Just install another apache. It's pretty simple to compile apache and
> mod_perl against your own perl, and it avoids needing to put a bunch
> of custom stuff in your httpd.conf to specify library paths, etc.

But you will likely want to compile Apache with the
--with-included-apr so that it uses the included apr libraries and not
those provided by Ubuntu.


Thanks for the suggestion. What's the problem with the one provided by =
Ubuntu?

Will it be used by default if I will compile Apache, or it won't be used =
at all?

Thanks.

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 21:38:14 von Perrin Harkins

On Mon, Jul 11, 2011 at 3:14 PM, Octavian Rasnita wrote:
> From: "Perrin Harkins"
> I am still afraid to compile Perl+Apache+mod_perl since the old days when I needed to do that because there were no other solutions, and when I needed to face some ugly compiling errors...
>
> But if you say that it is simple, I will try it.

I know some people have issues but I've never had any on common Linux
platforms. It complies very nicely. Just be sure to use the perl you
want to compile against when running Makefile.PL for mod_perl.

- Perrin

Re: Installing mod_perl for 2 versions of Perl?

am 11.07.2011 21:41:59 von Fred Moyer

On Mon, Jul 11, 2011 at 12:38 PM, Perrin Harkins wrote:
> On Mon, Jul 11, 2011 at 3:14 PM, Octavian Rasnita wr=
ote:
>> From: "Perrin Harkins"
>> I am still afraid to compile Perl+Apache+mod_perl since the old days whe=
n I needed to do that because there were no other solutions, and when I nee=
ded to face some ugly compiling errors...
>>
>> But if you say that it is simple, I will try it.
>
> I know some people have issues but I've never had any on common Linux
> platforms. =A0It complies very nicely. =A0Just be sure to use the perl yo=
u
> want to compile against when running Makefile.PL for mod_perl.

and the desired apxs binary with:

/my/perl Makefile.PL MP_APXS=3D/my/apxs

By default version 2.0.5 will look for installed apxs/apxs2 binaries
in certain places like your PATH and use those by default if you don't
explicitly specify which apxs binary to use.

Re: Installing mod_perl for 2 versions of Perl?

am 12.07.2011 07:03:03 von Octavian Rasnita

From: "Fred Moyer"

On Mon, Jul 11, 2011 at 12:38 PM, Perrin Harkins wrote:
> On Mon, Jul 11, 2011 at 3:14 PM, Octavian Rasnita
> wrote:
>> From: "Perrin Harkins"
>> I am still afraid to compile Perl+Apache+mod_perl since the old days when
>> I needed to do that because there were no other solutions, and when I
>> needed to face some ugly compiling errors...
>>
>> But if you say that it is simple, I will try it.
>
> I know some people have issues but I've never had any on common Linux
> platforms. It complies very nicely. Just be sure to use the perl you
> want to compile against when running Makefile.PL for mod_perl.

and the desired apxs binary with:

/my/perl Makefile.PL MP_APXS=/my/apxs

By default version 2.0.5 will look for installed apxs/apxs2 binaries
in certain places like your PATH and use those by default if you don't
explicitly specify which apxs binary to use.


Thank you for all the tips, Fred.

Octavian

Re: Installing mod_perl for 2 versions of Perl?

am 12.07.2011 07:20:05 von Vincent Veyron

Le lundi 11 juillet 2011 à 22:14 +0300, Octavian Rasnita a écrit :

>
> Mmm, I like the word "simple" :-)
>

These are the notes I took about a year ago for compilation on Debian of
Perl/Apache2/Mod_perl2. If I am not mistaken, they are all you need.

Look for 'Compilation' under each title.

Perl

Download source
wget -c http://www.cpan.org/src/stable.tar.gz
Compilation
./Configure -Dcc=gcc -Dprefix=/home/perl/5.X.X
-Dextras="Bundle::LWP DBI ExtUtils::XSBuilder DBD::Pg
DBD::SQLite Date::Simple URI::Escape Apache::Session
Apache::DBI"
make && make test && make install
Installation des modules
/home/perl/5.X.X/bin/perl -MCPAN -e shell

Apache2

Guide d'installation
http://perl.apache.org/docs/2.0/user/install/install.html
Download source
wget -c http://apache.crihan.fr/dist/httpd/httpd-2.X.X.tar.gz
Compilation
mkdir /home/httpd/2.X.X
CC="gcc-4.1" ./configure --prefix=/home/httpd/2.X.X
--enable-module=shared --enable-rewrite=shared
--enable-dir=shared
make && make install
Init.d script
scp /etc/init.d/apache2 192.168.1.6:'/etc/init.d'
Populate rc?.d
update-rc.d apache2 defaults 91

Mod_perl

Download source
http://perl.apache.org/download/index.html
Compilation
/home/perl/5.X.X/bin/perl Makefile.PL
MP_AP_PREFIX=/home/httpd/2.X.X
make && make test && make install
Éditer httpd.conf
LoadModule perl_module modules/mod_perl.so
Libapreq2
Download source
wget -c
http://mirror.mkhelif.fr/apache/httpd/libapreq/libapreq2-2.0 8.tar.gz
Compilation
/home/perl/5.X.X/bin/perl Makefile.PL
--with-apache2-apxs=/home/httpd/2.X.X/bin/apxs
--with-expat=/home/httpd/2.X.X/
make && make test && make install
edit httpd.conf
LoadModule apreq_module /home/httpd/2.X.X/modules/mod_apreq2.so



--
Vincent Veyron
http://marica.fr/
Logiciel de gestion des sinistres et des contentieux pour le service juridique