Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- From: "Sandeep Warikoo" <warikoo.sandeep@xxxxxxxxx>
- Subject: Re: [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- Date: Tue, 17 Oct 2006 17:53:47 +0530
------=_Part_121009_17649494.1161087827372
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi Georgi,
Changed RewriteLock to some other file. Still the problem persists.
On 10/17/06, Georgi Chorbadzhiyski <gf@unixsol.org> wrote:
>
> Sandeep Warikoo wrote:
> > I am facing a very strange problem with mod_rewrite module of Apache.
> > I am using an external program in perl to perform key-value mapping
> using
> > RewriteMap Directive.
> >
> > I have a very simple program:
> >
> > ---------------------
> > #!/usr/bin/perl
> >
> > $|=1;
> > $i = 1;
> >
> > while($input = <STDIN>)
> > {
> > print "$i\n";
> > $i++;
> > }
> > -------------------------
> >
> > And the RewriteRule is
> >
> > RewriteLock /root/demo.pl
>
> Are you sure this is correct? Try setting other LockFile than the script
> itself.
>
> > RewriteMap cvssvnrev prg:/root/demo.pl
> >
> > RewriteCond %{QUERY_STRING} ^rev=(.*)$
> > RewriteRule /viewcvs/viewcvs.cgi/(.*)
> > http://10.88.152.75/viewvc/trunk/$1?rev=${cvssvnrev:$1+%1} [L]
> >
> > This means that for first access to such url I should get "rev=1", for
> next
> > access "rev=2", and so on as query String. But
> >
> > what I get is "rev=" for first access, "rev=1" for second access,
> "rev=2"
> > for third access, i.e. the value I get is the one that was
> >
> > calculated during previous execution. It looks like the apache module
> after
> > writing to STDIN of this program doesn't wait for
> >
> > newline termination output from program (which it should so as per
> > specification), but immediately reads whatever is on pipe
> >
> > which is nothing for first execution, and output of previous executions
> for
> > rest of executions.
> >
> > Is this a bug in mod_rewrite module (I am using Apache version 2.2)? Or
> > there is some option I have missed?
>
> --
> Georgi Chorbadzhiyski
> http://georgi.unixsol.org/
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
------=_Part_121009_17649494.1161087827372
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<div>Hi Georgi,</div>
<div> </div>
<div>Changed RewriteLock to some other file. Still the problem persists.<br><br> </div>
<div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">Georgi Chorbadzhiyski</b> <<a href="mailto:gf@unixsol.org">gf@unixsol.org</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Sandeep Warikoo wrote:<br>> I am facing a very strange problem with mod_rewrite module of Apache.<br>> I am using an external program in perl to perform key-value mapping using
<br>> RewriteMap Directive.<br>><br>> I have a very simple program:<br>><br>> ---------------------<br>> #!/usr/bin/perl<br>><br>> $|=1;<br>> $i = 1;<br>><br>> while($input = <STDIN>)
<br>> {<br>> print "$i\n";<br>> $i++;<br>> }<br>> -------------------------<br>><br>> And the RewriteRule is<br>><br>> RewriteLock /root/demo.pl<br><br>Are you sure this is correct? Try setting other LockFile than the script itself.
<br><br>> RewriteMap cvssvnrev prg:/root/demo.pl<br>><br>> RewriteCond %{QUERY_STRING} ^rev=(.*)$<br>> RewriteRule /viewcvs/viewcvs.cgi/(.*)<br>> <a href="http://10.88.152.75/viewvc/trunk/$1?rev=${cvssvnrev:$1+%1}">
http://10.88.152.75/viewvc/trunk/$1?rev=${cvssvnrev:$1+%1}</a> [L]<br>><br>> This means that for first access to such url I should get "rev=1", for next<br>> access "rev=2", and so on as query String. But
<br>><br>> what I get is "rev=" for first access, "rev=1" for second access, "rev=2"<br>> for third access, i.e. the value I get is the one that was<br>><br>> calculated during previous execution. It looks like the apache module after
<br>> writing to STDIN of this program doesn't wait for<br>><br>> newline termination output from program (which it should so as per<br>> specification), but immediately reads whatever is on pipe<br>><br>> which is nothing for first execution, and output of previous executions for
<br>> rest of executions.<br>><br>> Is this a bug in mod_rewrite module (I am using Apache version 2.2)? Or<br>> there is some option I have missed?<br><br>--<br>Georgi Chorbadzhiyski<br><a href="http://georgi.unixsol.org/">
http://georgi.unixsol.org/</a><br><br>---------------------------------------------------------------------<br>The official User-To-User support forum of the Apache HTTP Server Project.<br>See <URL:<a href="http://httpd.apache.org/userslist.html">
http://httpd.apache.org/userslist.html</a>> for more info.<br>To unsubscribe, e-mail: <a href="mailto:users-unsubscribe@httpd.apache.org">users-unsubscribe@httpd.apache.org</a><br> " from the digest: <a href="mailto:users-digest-unsubscribe@httpd.apache.org">
users-digest-unsubscribe@httpd.apache.org</a><br>For additional commands, e-mail: <a href="mailto:users-help@httpd.apache.org">users-help@httpd.apache.org</a><br><br></blockquote></div><br>
------=_Part_121009_17649494.1161087827372--
- References:
- [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- From: Sandeep Warikoo
- Re: [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- From: Georgi Chorbadzhiyski
- [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- Prev by Date: Re: [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- Next by Date: [users@httpd] LDAP support apache 2.2.3 - solution compiling
- Previous by thread: Re: [users@httpd] Proglem with RewriteMap directive (mod_rewrite module)
- Next by thread: [users@httpd] LDAP support apache 2.2.3 - solution compiling
- Index(es):