Re: httpd.conf problem.

1999-10-09 Thread Stas Bekman

 Inside a Perl section I want to configure mod_rewrite dynamically,
 this works:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
 
 If I do this:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
   $RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT]";
 
 the last RewriteRule will hide the first one. 
 
 The following attempts to not work at all: 
   push(@RewriteRule , "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl", "[PT]");
   $RewriteRule{'/cgi-bin/printenv'} = "/cgi-bin/slave.pl [PT]";
 
 Am I missing something obvious? 
 
 I am using Apache/1.3.9 with mod_perl/1.21 in case ut matters. 

1. Do your non-dynamic configuration works as you expect it to? I mean
if you write plain mod_rewrite directives?

2. If the answer to the Q1 is "yes", you should print out the dynamically
confugured stuff, to debug the issue:

  Perl
  use Apache::PerlSections();
  ...
  print STDERR Apache-PerlSections-dump();
  /Perl

I beleive, that once you can debug this beast, you can find where the
problem lies or at least who causes it.

___
Stas Bekman  mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas  
Perl,CGI,Apache,Linux,Web,Java,PC at  www.singlesheaven.com/stas/TULARC
www.apache.org   www.perl.com  == www.modperl.com  ||  perl.apache.org
single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com



RE: httpd.conf problem.

1999-10-09 Thread Eric Cholet

On Friday, October 08, 1999 4:26 PM, Terje Malmedal [SMTP:[EMAIL PROTECTED]] wrote:
 
 Hi,
 
 Inside a Perl section I want to configure mod_rewrite dynamically,
 this works:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
 
 If I do this:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
   $RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT]";
 

This should work (from the book, chapter 8):

@RewriteRule = (
[ "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]" ],
[ "/cgi-bin/test  /cgi-bin/slave.pl [PT]" ],
 );


 the last RewriteRule will hide the first one. 
 
 The following attempts to not work at all: 
   push(@RewriteRule , "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl", "[PT]");
   $RewriteRule{'/cgi-bin/printenv'} = "/cgi-bin/slave.pl [PT]";
 
 Am I missing something obvious? 
 
 I am using Apache/1.3.9 with mod_perl/1.21 in case ut matters. 
 
 -- 
  - Terje
 [EMAIL PROTECTED]

--
Eric



Re: httpd.conf problem.

1999-10-08 Thread Michael Hall

On Fri, Oct 08, 1999 at 04:25:39PM +0200, Terje Malmedal wrote:

 Inside a Perl section I want to configure mod_rewrite dynamically,
 this works:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
 
 If I do this:
 
   $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
   $RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT]";
 
 the last RewriteRule will hide the first one. 
 
 The following attempts to not work at all: 
   push(@RewriteRule , "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl [PT]");
   push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl", "[PT]");
   $RewriteRule{'/cgi-bin/printenv'} = "/cgi-bin/slave.pl [PT]";
 
 Am I missing something obvious? 

  Have you tried using the 'L' flag (see Apache manual) this will stop
further processing, ie:

$RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT,L]";
$RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT,L]";

--
I've been dead before. - Captain Spock, Star Trek VI

Mike Hall [EMAIL PROTECTED], ICQ: #37292579, http://www.riverside.org
System Administrator (MH993) (*nix, OS/2 certified - C, Perl, CGI hacker)



Re: httpd.conf problem.

1999-10-08 Thread Cliff Rayman

I've never used perl sections, but unless $RewriteRule is some magic variable,
the second assignment simply overwrites the first one.

I thought it had to be something along the lines of:

push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl [PT]");

or

$RewriteRule{"/cgi-bin/printenv"}="/cgi-bin/slave.pl [PT]";

cliff rayman
genwax.com

Michael Hall wrote:

 On Fri, Oct 08, 1999 at 04:25:39PM +0200, Terje Malmedal wrote:

  Inside a Perl section I want to configure mod_rewrite dynamically,
  this works:
 
$RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
 
  If I do this:
 
$RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]";
$RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT]";
 
  the last RewriteRule will hide the first one.
 
  The following attempts to not work at all:
push(@RewriteRule , "/cgi-bin/printenv  /cgi-bin/slave.pl [PT]");
push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl [PT]");
push(@RewriteRule , "/cgi-bin/printenv" , "/cgi-bin/slave.pl", "[PT]");
$RewriteRule{'/cgi-bin/printenv'} = "/cgi-bin/slave.pl [PT]";
 
  Am I missing something obvious?

   Have you tried using the 'L' flag (see Apache manual) this will stop
 further processing, ie:

 $RewriteRule = "/cgi-bin/printenv  /cgi-bin/slave.pl [PT,L]";
 $RewriteRule = "/cgi-bin/test  /cgi-bin/slave.pl [PT,L]";

 --
 I've been dead before. - Captain Spock, Star Trek VI

 Mike Hall [EMAIL PROTECTED], ICQ: #37292579, http://www.riverside.org
 System Administrator (MH993) (*nix, OS/2 certified - C, Perl, CGI hacker)



Re: httpd.conf problem.

1999-10-08 Thread Michael Hall

On Fri, Oct 08, 1999 at 11:54:58AM -0700, Cliff Rayman wrote:

 I've never used perl sections, but unless $RewriteRule is some magic variable,
 the second assignment simply overwrites the first one.
  
  Sorry for my previous post, I see the problem now after re-reading things.
At first glance I thought he was having different problems and suggested the
'L' switch. I've never done anything similar to what he's doing so I don't
have a suggestion for that, sorry about any confusion, got to try and
remember to fully read before replying :-)

snip

--
If I told you you had a beautiful body, would you hold it against me ?

Mike Hall [EMAIL PROTECTED], ICQ: #37292579, http://www.riverside.org
System Administrator (MH993) (*nix, OS/2 certified - C, Perl, CGI hacker)