You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Randy Kobes <ra...@theoryx5.uwinnipeg.ca> on 2001/04/23 08:25:59 UTC

win32 and apache_1.3.19

Hi,
    Apache_1.3.19 on Win32 has changed the way os.h in
the apache source tree is included, so that mod_perl no
longer finds it if built via command-line arguments. I've
attached a patch against the cvs mod_perl which builds
a mod_perl.dsp to include the relevant apache directory.
   This patch also includes the t/TEST.win32 patch sent
earlier to account for the fact that apache_1.3.19 on Win32
sets the relative server root to the path to the apache binary, 
so that $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
points to the path of the apache binary, rather than the mod_perl
build directory, and subsequently the tests get confused
since @INC doesn't contain the mod_perl build directory.
Finally, there's some changes in mod_perl.dsp to use some
generic include and lib paths - these don't really matter, as
they have to be set anyway for the local system, but this
may make the needed changes more obvious to a
user if things are configured manually.

best regards,
randy kobes


Re: win32 and apache_1.3.19

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
----- Original Message ----- 
From: "Randy Kobes" <ra...@theoryx5.uwinnipeg.ca>
To: <de...@perl.apache.org>
Sent: Monday, April 23, 2001 1:25 AM
Subject: win32 and apache_1.3.19


> Hi,
>     Apache_1.3.19 on Win32 has changed the way os.h in
> the apache source tree is included, so that mod_perl no
> longer finds it if built via command-line arguments. I've
> attached a patch against the cvs mod_perl which builds
> a mod_perl.dsp to include the relevant apache directory.
>    This patch also includes the t/TEST.win32 patch sent
> earlier to account for the fact that apache_1.3.19 on Win32
> sets the relative server root to the path to the apache binary, 
> so that $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
> points to the path of the apache binary, rather than the mod_perl
> build directory, and subsequently the tests get confused
> since @INC doesn't contain the mod_perl build directory.
> Finally, there's some changes in mod_perl.dsp to use some
> generic include and lib paths - these don't really matter, as
> they have to be set anyway for the local system, but this
> may make the needed changes more obvious to a
> user if things are configured manually.

Additionally, a recent patch to the top-level Makefile.PL
removed some Win32-specific values that were
present in Apache::MyConfig that recorded the mod_perl
and apache paths used to build mod_perl. These are put
back in in the attached patch, which also includes the
patches described above.

best regards,
randy kobes


Re: win32 and apache_1.3.19

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 27 Apr 2001, Randy Kobes wrote:
 
> that's great ... this is done in the attached patch (against today's
> cvs mod_perl), and all works with perl-5.6.1 and apache_1.3.19.
> i also included in this patch the earlier patches for getting the
> right apache_1.3.19 inc directories, inserting some win32-specific
> values in Apache::MyConfig, and changing some apache paths
> in mod_perl.dsp to more generic values. 

cool, applied, thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: win32 and apache_1.3.19

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
----- Original Message ----- 
From: "Doug MacEachern" <do...@covalent.net>
To: "Randy Kobes" <ra...@theoryx5.uwinnipeg.ca>
Cc: <de...@perl.apache.org>
Sent: Thursday, April 26, 2001 8:57 PM
Subject: Re: win32 and apache_1.3.19


> how about having Makefile.PL generate a file that sets
> $Apache::Server::CWD, which is then PerlRequire'd by httpd.conf?
> i'd just rather avoid modifying the distribution files.

that's great ... this is done in the attached patch (against today's
cvs mod_perl), and all works with perl-5.6.1 and apache_1.3.19.
i also included in this patch the earlier patches for getting the
right apache_1.3.19 inc directories, inserting some win32-specific
values in Apache::MyConfig, and changing some apache paths
in mod_perl.dsp to more generic values. 

best regards,
randy


Re: win32 and apache_1.3.19

Posted by Doug MacEachern <do...@covalent.net>.
how about having Makefile.PL generate a file that sets
$Apache::Server::CWD, which is then PerlRequire'd by httpd.conf?
i'd just rather avoid modifying the distribution files.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: win32 and apache_1.3.19

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
----- Original Message ----- 
From: "Doug MacEachern" <do...@covalent.net>
To: "Randy Kobes" <ra...@theoryx5.uwinnipeg.ca>
Cc: <de...@perl.apache.org>
Sent: Monday, April 23, 2001 11:04 PM
Subject: Re: win32 and apache_1.3.19


> On Mon, 23 Apr 2001, Randy Kobes wrote:
> 
> >    This patch also includes the t/TEST.win32 patch sent
> > earlier to account for the fact that apache_1.3.19 on Win32
> > sets the relative server root to the path to the apache binary, 
> > so that $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
> > points to the path of the apache binary, rather than the mod_perl
> > build directory, and subsequently the tests get confused
> > since @INC doesn't contain the mod_perl build directory.
> 
> did you see my reply to your original message (included below) ?
> thanks as always randy!
[ ... ]

Hi,
     No, I didn't get that - we may have been having some local
network glitches around that time ....

> On Sat, 14 Apr 2001, Randy Kobes wrote:
> 
> > Hi,
> >    One of the changes in apache_1.3.19 for Win32 is that the
> > relative ServerRoot was changed to root to the path
> > of the apache binary. This has the effect of setting
> > $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
> > to the path of the apache binary, rather than the mod_perl
> > build directory, and subsequently the tests can't be run
> > since @INC doesn't contain the mod_perl build directory.
> > The following patch against mod_perl-1.25, tested on
> > apache_1.3.19 and perl-5.6.1, fixes this by simply
> > substituting the mod_perl build directory for
> > $Apache::Server::CWD in these two files.
> 
> i'd rather not iedit those files.  will something like the patch below
> solve the problem?  thanks randy.
> 
> Index: Makefile.PL
> ===================================================================
> RCS file: /home/cvs/modperl/Makefile.PL,v
> retrieving revision 1.179
> diff -u -r1.179 Makefile.PL
> --- Makefile.PL 2001/04/17 21:38:52 1.179
> +++ Makefile.PL 2001/04/17 22:20:02
> @@ -95,6 +95,7 @@
>      $Apache::MyConfig::Setup{Apache_Src} ; 
>  
>  my $PWD = cwd;
> +$ENV{APACHE_CWD} = $PWD;
>  $ENV{PERL5LIB} = "$PWD/lib";
[ ... ]

This turned out to be an interesting problem ....
Basically $ENV{APACHE_CWD}, set within
Makefile.PL, or even in t/TEST.win32, doesn't
survive the trip to t/docs/startup.pl. I checked
the bug database at ActiveState, and apparently
it's a problem with Win32::Process - it does 
inherit environment variables from the console
window from which the script is run, but doesn't
see changes in %ENV made within that
script (this did work in ActivePerl 5xx). A fix
is being worked on .... 

In the meantime, I tried a couple of workarounds,
but these weren't very satisfactory. One could
put an environment variable temporarily in the 
Registry, but this seems overkill. Alternatively,
apparently there's a program called 
WINSET which can set console environment 
variables in a system() call, but WINSET isn't
installed in a stock Win32. Another option
is to write a batch file which sets APACHE_CWD
and then starts apache, and then execute this
batch file with Win32::Process - this works,
but again seems like overkill. I'll think
about this some more ....

best regards,
randy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: win32 and apache_1.3.19

Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 23 Apr 2001, Randy Kobes wrote:

>    This patch also includes the t/TEST.win32 patch sent
> earlier to account for the fact that apache_1.3.19 on Win32
> sets the relative server root to the path to the apache binary, 
> so that $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
> points to the path of the apache binary, rather than the mod_perl
> build directory, and subsequently the tests get confused
> since @INC doesn't contain the mod_perl build directory.

did you see my reply to your original message (included below) ?
thanks as always randy!

>From dougm@covalent.net Tue Apr 17 15:20:39 2001 -0700
Status: 
X-Status: 
X-Keywords:
Date: Tue, 17 Apr 2001 15:20:39 -0700 (PDT)
From: Doug MacEachern <do...@covalent.net>
To: Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
cc: dev@perl.apache.org
Subject: Re: relative ServerRoot in Win32
In-Reply-To: <00...@oemcomputer>
Message-ID: <Pi...@mako.covalent.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Sat, 14 Apr 2001, Randy Kobes wrote:

> Hi,
>    One of the changes in apache_1.3.19 for Win32 is that the
> relative ServerRoot was changed to root to the path
> of the apache binary. This has the effect of setting
> $Apache::Server::CWD in t/docs/startup.pl and t/docs/rl.pl
> to the path of the apache binary, rather than the mod_perl
> build directory, and subsequently the tests can't be run
> since @INC doesn't contain the mod_perl build directory.
> The following patch against mod_perl-1.25, tested on
> apache_1.3.19 and perl-5.6.1, fixes this by simply
> substituting the mod_perl build directory for
> $Apache::Server::CWD in these two files.

i'd rather not iedit those files.  will something like the patch below
solve the problem?  thanks randy.

Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl/Makefile.PL,v
retrieving revision 1.179
diff -u -r1.179 Makefile.PL
--- Makefile.PL	2001/04/17 21:38:52	1.179
+++ Makefile.PL	2001/04/17 22:20:02
@@ -95,6 +95,7 @@
     $Apache::MyConfig::Setup{Apache_Src} ; 
 
 my $PWD = cwd;
+$ENV{APACHE_CWD} = $PWD;
 $ENV{PERL5LIB} = "$PWD/lib";
 
 my %SSL = (
Index: t/docs/startup.pl
===================================================================
RCS file: /home/cvs/modperl/t/docs/startup.pl,v
retrieving revision 1.40
diff -u -r1.40 startup.pl
--- t/docs/startup.pl	2000/12/23 00:32:21	1.40
+++ t/docs/startup.pl	2001/04/17 22:20:08
@@ -5,6 +5,10 @@
 }
 
 BEGIN {
+    $Apache::Server::CWD = $ENV{APACHE_CWD} if $ENV{APACHE_CWD};
+}
+
+BEGIN {
     #./blib/lib:./blib/arch
     use ExtUtils::testlib;
 
Index: t/conf/httpd.conf-dist
===================================================================
RCS file: /home/cvs/modperl/t/conf/httpd.conf-dist,v
retrieving revision 1.32
diff -u -r1.32 httpd.conf-dist
--- t/conf/httpd.conf-dist	2000/09/26 16:55:41	1.32
+++ t/conf/httpd.conf-dist	2001/04/17 22:20:14
@@ -55,7 +55,7 @@
 #mod_perl stuff
 
 
-PerlPassEnv TERM EDITOR NOCHANCE USER PERL5LIB
+PerlPassEnv TERM EDITOR NOCHANCE USER PERL5LIB APACHE_CWD
 PerlSetEnv KeyForPerlSetEnv OK
 PerlSetVar KeyForPerlSetVar OK
  



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org