Re: Apache1/mp1 and Apache2/mp2 on the same machine

[prev] [thread] [next] [Date index for 2005/04/19]

From: Scott Cain
Subject: Re: Apache1/mp1 and Apache2/mp2 on the same machine
Date: 21:18 on 19 Apr 2005
I am using turnkey (http://turnkey.sf.net) which tries to do some fancy
footwork to determine which mod_perl is being used:

(note that Turnkey::Root::mod_perl_version parses $ENV{MOD_PERL} and
returns 2 if it looks like mod_perl 1.99+ or 1 otherwise):

if (Turnkey::Root::mod_perl_version( $ENV{MOD_PERL} ) == 1) {

    # do mod_perl1 set up stuff, like:

  $STRATEGY_COOKIE  = 'Apache::Cookie';
  $STRATEGY_REQUEST = 'Apache::Request';

  eval qq(
    use Apache::Constants qw(:common DECLINED REDIRECT);
    use Apache::Request;
    use Apache::Cookie;
  );

} elsif (Turnkey::Root::mod_perl_version( $ENV{MOD_PERL} ) == 2) {

    # do mod_perl2 set up stuff, like:

  $STRATEGY_COOKIE  = 'CGI::Cookie';
  $STRATEGY_REQUEST = 'Apache::RequestRec';

  eval qq(
    use Apache::Const -compile => qw(:common :http REDIRECT M_GET);
    use Apache::RequestUtil;
    use APR::Table;
    use CGI::Cookie;
    use Apache::ParseFormData;

    $declined = Apache::DECLINED;
    $not_implemented = Apache::HTTP_NOT_IMPLEMENTED;
    $m_get = Apache::M_GET;
  );

} else {
  die("what kind of mod_perl is '".mod_perl_version( $ENV{MOD_PERL} )."'?");
}

Here is Turnkey::Root::mod_perl_version:

BEGIN {
  sub mod_perl_version {
    my $MOD_PERL_VERSION = shift if @_;

    $MOD_PERL_VERSION =~ s/^.*?([\d.]+).*?$/$1/;
    eval "require mod_perl";

    if($MOD_PERL_VERSION >= 1.99){
      $MOD_PERL_VERSION = 2;
    } else {
      $MOD_PERL_VERSION = 1;
    }

    return $MOD_PERL_VERSION;
  }
}

Is there any reason to believe that would work now as opposed to not
working before?  It appeared that before, at least some of the time,
even though I was using Apache2, the mod_perl_version method would
return '1' and muck things up.

Thanks,
Scott


On Tue, 2005-04-19 at 17:11 -0400, Philip M. Gollucci wrote:
> Scott Cain wrote:
> 
> >I did see the rename doc, though I didn't realize that it applied to
> >something as recent as the transition to RC4->RC5.  Are you currently
> >using mp1 and mp2?  What about any mp applications that were written
> >prior to this name change?   Of course, I can't do any testing myself,
> >because I had to blow away my installation of mp1 to get my mp2 apps to
> >work.
> >  
> >
> Yes, I have both mp1 and mp2 installed on my laptop.
> You'd have to be more specific about applications.
> Some work some don't :)
> 
> 
        -- 
        ------------------------------------------------------------------------
Scott Cain, Ph. D.                                         cain@xxxx.xxx
GMOD Coordinator (http://www.gmod.org/)                     216-392-3087
Cold Spring Harbor Laboratory

(message missing)

Re: Apache1/mp1 and Apache2/mp2 on the same machine
Philip M. Gollucci 20:51 on 19 Apr 2005

Re: Apache1/mp1 and Apache2/mp2 on the same machine
Philip M. Gollucci 21:11 on 19 Apr 2005

Re: Apache1/mp1 and Apache2/mp2 on the same machine
Scott Cain 21:18 on 19 Apr 2005

Re: Apache1/mp1 and Apache2/mp2 on the same machine
Philip M. Gollucci 21:26 on 19 Apr 2005

Re: Apache1/mp1 and Apache2/mp2 on the same machine
___cliff rayman___ 21:14 on 19 Apr 2005

Re: Apache1/mp1 and Apache2/mp2 on the same machine
Perrin Harkins 21:37 on 19 Apr 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52