Re: $r->args()

2001-08-29 Thread Rasoul Hajikhani

Robert Landrum wrote:
> 
> At 11:19 AM -0700 8/29/01, Rasoul Hajikhani wrote:
> >Robert Landrum wrote:
> >>
> >> > > Which should solve your problems (I think).
> >> >
> >> >I am affraid it did not work. I have no problem reading the data in the
> >> >current handler, but right after redirect, which is also required to
> >> >read the data, I loose all the POSTED data.
> >>
> >> Performing a redirect causes posted data to be discarded.
> >
> >Did not find that in docs! maybe should pay more attention :(
> 
> I'm sure it's in the docs somewhere, but personal experience and
> previous posts to this list have addressed this issue.
> 
> > > Your goal should be to convert
> >
> >?? You lost me there... "convert"? convert to what?
> 
> Convert as in from POST request to GET request.
> 
> sub escaped {
> my $val = shift;
> $val =~ s/(\W)/sprintf("%%%.2X",ord($1))/g;
> return $val;
> }
> 
> my $content = join('&',map{$_."=".escaped($r->param($_))}($r->param));
> 
> my $internal_url = "/some/path/to/handler?$content";
> $r->internal_redirect($internal_url);
> 
> >
> >>all of your posted data so that it can be passed via GET.
> >
> >Would it make any diference if the method, and method_number remained
> >POST? Does this situation occure as a result of method conversion? (I
> >will try that)...
> 
> Unlikely.
> 
> >
> >-r
> >
> >PS: Something wrong with the mail server?
> 
> Uhh... Why?
> 
> Rob
> 
> --
> "A good magician never reveals his secret; the unbelievable trick
> becomes simple and obvious once it is explained. So too with UNIX."

Thanks... It now works...
-r



Re: $r->args()

2001-08-29 Thread Ken Williams

[EMAIL PROTECTED] (Rasoul Hajikhani) wrote:

>Robert Landrum wrote:
>> 
>> > > Which should solve your problems (I think).
>> >
>> >I am affraid it did not work. I have no problem reading the data in the
>> >current handler, but right after redirect, which is also required to
>> >read the data, I loose all the POSTED data.
>> 
>> Performing a redirect causes posted data to be discarded. 
>
>Did not find that in docs! maybe should pay more attention :(

You'll find the relevant material in the HTTP/1.1 docs:

  http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc2068.html


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum



Re: is postreadrequest too late to determine name vhost?

2001-08-29 Thread Thomas Eibner

On Wed, Aug 29, 2001 at 02:44:48PM -0400, Vivek Khera wrote:
> > "TE" == Thomas Eibner <[EMAIL PROTECTED]> writes:
> 
> TE> It seems that everything concerning vhosts is set up in http_protocal.c
> TE> and that the vhost is set right after Apache has read the request from 
> TE> the client and then calling ap_update_vhost_from_headers to actually
> TE> determine the vhost. All this happens before your module gets to run.
> 
> Thanks for the info.  I realized just now (about a minute ago) that
> localhost.mailermailer.com and localhost.m1e.net are different names
> that point to 127.0.0.1, so the proxy front-end can do it using the
> domain names, and the back-end can distinguish the names just fine.

I have a reverse-mpaf almost working with this now, so that it works
without using the localhost.hostname.com.. 

-- 
  Thomas Eibner  DnsZone 
  mod_pointer  




Re: $r->args()

2001-08-29 Thread Robert Landrum

At 11:19 AM -0700 8/29/01, Rasoul Hajikhani wrote:
>Robert Landrum wrote:
>>
>> > > Which should solve your problems (I think).
>> >
>> >I am affraid it did not work. I have no problem reading the data in the
>> >current handler, but right after redirect, which is also required to
>> >read the data, I loose all the POSTED data.
>>
>> Performing a redirect causes posted data to be discarded.
>
>Did not find that in docs! maybe should pay more attention :(

I'm sure it's in the docs somewhere, but personal experience and 
previous posts to this list have addressed this issue.


> > Your goal should be to convert
>
>?? You lost me there... "convert"? convert to what?

Convert as in from POST request to GET request.

sub escaped {
my $val = shift;
$val =~ s/(\W)/sprintf("%%%.2X",ord($1))/g;
return $val;
}

my $content = join('&',map{$_."=".escaped($r->param($_))}($r->param));

my $internal_url = "/some/path/to/handler?$content";
$r->internal_redirect($internal_url);

>
>>all of your posted data so that it can be passed via GET.
>
>Would it make any diference if the method, and method_number remained
>POST? Does this situation occure as a result of method conversion? (I
>will try that)...

Unlikely.


>
>-r
>
>PS: Something wrong with the mail server?

Uhh... Why?

Rob

--
"A good magician never reveals his secret; the unbelievable trick
becomes simple and obvious once it is explained. So too with UNIX." 



Re: is postreadrequest too late to determine name vhost?

2001-08-29 Thread Vivek Khera

> "TE" == Thomas Eibner <[EMAIL PROTECTED]> writes:

TE> It seems that everything concerning vhosts is set up in http_protocal.c
TE> and that the vhost is set right after Apache has read the request from 
TE> the client and then calling ap_update_vhost_from_headers to actually
TE> determine the vhost. All this happens before your module gets to run.

Thanks for the info.  I realized just now (about a minute ago) that
localhost.mailermailer.com and localhost.m1e.net are different names
that point to 127.0.0.1, so the proxy front-end can do it using the
domain names, and the back-end can distinguish the names just fine.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: is postreadrequest too late to determine name vhost?

2001-08-29 Thread Thomas Eibner

On Wed, Aug 29, 2001 at 01:31:54PM -0400, Vivek Khera wrote:
> I've got the classic lightweight front end proxying to the mod_perl
> heavyweight backend.  I use proxy_add_forward on the front end and the
> PerlPostReadRequest handler to set $r->hostname and $r->remote_ip.
> 
> This all works excellently.  My question, however, is this too late
> for the name-based virtual hosts to trigger?  In my mod_perl app, I
> need to trigger different things based on the virtual site.  What I
> want to do is this:
> 
> 
>  ServerName www.mailermailer.com
>  PerlSetVar SiteID 7
>  PerlSetVar SiteName www.mailermailer.com
> 
> 
> 
>  ServerName m1e.net
>  PerlSetVar SiteID 1
>  PerlSetVar SiteName m1e.net
> 
> 
> in the backend.
> 
> However, it seems that it always picks up the first virtual host
> defined this way, regardless of what the post read request handler
> sets $r->hostname to.
> 
> Is there some other trick I should try?  I'm working from home today
> and don't have my Eagle book handy...
> 
> If I can't get it to work with name virtual hosts, I'll have to go to
> port-based virtual hosts, which I'd prefer to avoid since I expect to
> have several hundred of these eventually.

It seems that everything concerning vhosts is set up in http_protocal.c
and that the vhost is set right after Apache has read the request from 
the client and then calling ap_update_vhost_from_headers to actually
determine the vhost. All this happens before your module gets to run.
It might be possible to create a C module that sets the Host: header 
like you want it to be and then call ap_update_vhost_from_headers.

-- 
  Thomas Eibner  DnsZone 
  mod_pointer  




Re: $r->args()

2001-08-29 Thread Rasoul Hajikhani

Robert Landrum wrote:
> 
> > > Which should solve your problems (I think).
> >
> >I am affraid it did not work. I have no problem reading the data in the
> >current handler, but right after redirect, which is also required to
> >read the data, I loose all the POSTED data.
> 
> Performing a redirect causes posted data to be discarded. 

Did not find that in docs! maybe should pay more attention :(

> Your goal should be to convert 

?? You lost me there... "convert"? convert to what? 

>all of your posted data so that it can be passed via GET.

Would it make any diference if the method, and method_number remained
POST? Does this situation occure as a result of method conversion? (I
will try that)...

-r

PS: Something wrong with the mail server?
> 
> Rob
> 
> --
> "A good magician never reveals his secret; the unbelievable trick
> becomes simple and obvious once it is explained. So too with UNIX."



Re: $r->args()

2001-08-29 Thread Tom Servo

Once you change the method to GET and put the content in with $r->args();,
it becomes GET data from the query_string.   All the POST data is lost
when you call content(), so you can no longer read it as POST data with
$r->content() again.


Brian Nilsen
[EMAIL PROTECTED]

On Wed, 29 Aug 2001, Rasoul Hajikhani wrote:

> Robert Landrum wrote:
> > 
> > At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote:
> > >Hello,
> > >I already have asked this question and got an answer for it, so please
> > >accept my forwarded apologies. However, I was trying something else and
> > >got stuck. I know in order to pass around query string, or form data,
> > >pnotes may be used. However, I am trying something else and it does not
> > >seem to work!
> > >
> > >   $r = Apache::Request->new($r);
> > >   # check for some condition
> > >   if ($condition)
> > >   {
> > >   my $previous_uri= $r->param('previous_uri');
> > >
> > >my $content = $r->param();
> > >
> > >$r->method_number(M_GET);
> > >$r->method('GET');
> > >
> > >$r->headers_in->unset("Content-length");
> > >
> > >$r->args($content);
> > >
> > >$r->internal_redirect("$previous_uri");
> > >   }
> > 
> > So your goal is to turn a post request into a get request using an
> > internal redirect.
> > 
> > >However, in my called handler, no Post data can be read. Can any one
> > >tell me why is that?
> > >Any comments welcomed...
> > 
> > param does not work like args, and $content in this example will
> > return the number of param keys (IIRC).
> > 
> > I think you want
> > 
> > my $content = join('&',map{$_."=".$r->param($_)}($r->param));
> > 
> > Which should solve your problems (I think).
> 
> I am affraid it did not work. I have no problem reading the data in the
> current handler, but right after redirect, which is also required to
> read the data, I loose all the POSTED data.
> > 
> > Rob
> > 
> > --
> > "A good magician never reveals his secret; the unbelievable trick
> > becomes simple and obvious once it is explained. So too with UNIX."
> 




Re: $r->args()

2001-08-29 Thread Robert Landrum

> > Which should solve your problems (I think).
>
>I am affraid it did not work. I have no problem reading the data in the
>current handler, but right after redirect, which is also required to
>read the data, I loose all the POSTED data.

Performing a redirect causes posted data to be discarded.  Your goal 
should be to convert all of your posted data so that it can be passed 
via GET.

Rob


--
"A good magician never reveals his secret; the unbelievable trick
becomes simple and obvious once it is explained. So too with UNIX." 



Re: $r->args()

2001-08-29 Thread Rasoul Hajikhani

Robert Landrum wrote:
> 
> At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote:
> >Hello,
> >I already have asked this question and got an answer for it, so please
> >accept my forwarded apologies. However, I was trying something else and
> >got stuck. I know in order to pass around query string, or form data,
> >pnotes may be used. However, I am trying something else and it does not
> >seem to work!
> >
> >   $r = Apache::Request->new($r);
> >   # check for some condition
> >   if ($condition)
> >   {
> >   my $previous_uri= $r->param('previous_uri');
> >
> >my $content = $r->param();
> >
> >$r->method_number(M_GET);
> >$r->method('GET');
> >
> >$r->headers_in->unset("Content-length");
> >
> >$r->args($content);
> >
> >$r->internal_redirect("$previous_uri");
> >   }
> 
> So your goal is to turn a post request into a get request using an
> internal redirect.
> 
> >However, in my called handler, no Post data can be read. Can any one
> >tell me why is that?
> >Any comments welcomed...
> 
> param does not work like args, and $content in this example will
> return the number of param keys (IIRC).
> 
> I think you want
> 
> my $content = join('&',map{$_."=".$r->param($_)}($r->param));
> 
> Which should solve your problems (I think).

I am affraid it did not work. I have no problem reading the data in the
current handler, but right after redirect, which is also required to
read the data, I loose all the POSTED data.
> 
> Rob
> 
> --
> "A good magician never reveals his secret; the unbelievable trick
> becomes simple and obvious once it is explained. So too with UNIX."



Re: $r->args()

2001-08-29 Thread Robert Landrum

At 9:36 AM -0700 8/29/01, Rasoul Hajikhani wrote:
>Hello,
>I already have asked this question and got an answer for it, so please
>accept my forwarded apologies. However, I was trying something else and
>got stuck. I know in order to pass around query string, or form data,
>pnotes may be used. However, I am trying something else and it does not
>seem to work!
>
>   $r = Apache::Request->new($r);
>   # check for some condition
>   if ($condition)
>   {
>   my $previous_uri= $r->param('previous_uri');
>
>my $content = $r->param();
>
>$r->method_number(M_GET);
>$r->method('GET');
>
>$r->headers_in->unset("Content-length");
>
>$r->args($content);
>
>$r->internal_redirect("$previous_uri");
>   }


So your goal is to turn a post request into a get request using an 
internal redirect.




>However, in my called handler, no Post data can be read. Can any one
>tell me why is that?
>Any comments welcomed...



param does not work like args, and $content in this example will 
return the number of param keys (IIRC).

I think you want

my $content = join('&',map{$_."=".$r->param($_)}($r->param));

Which should solve your problems (I think).

Rob




--
"A good magician never reveals his secret; the unbelievable trick
becomes simple and obvious once it is explained. So too with UNIX." 



is postreadrequest too late to determine name vhost?

2001-08-29 Thread Vivek Khera

I've got the classic lightweight front end proxying to the mod_perl
heavyweight backend.  I use proxy_add_forward on the front end and the
PerlPostReadRequest handler to set $r->hostname and $r->remote_ip.

This all works excellently.  My question, however, is this too late
for the name-based virtual hosts to trigger?  In my mod_perl app, I
need to trigger different things based on the virtual site.  What I
want to do is this:


 ServerName www.mailermailer.com
 PerlSetVar SiteID 7
 PerlSetVar SiteName www.mailermailer.com



 ServerName m1e.net
 PerlSetVar SiteID 1
 PerlSetVar SiteName m1e.net


in the backend.

However, it seems that it always picks up the first virtual host
defined this way, regardless of what the post read request handler
sets $r->hostname to.

Is there some other trick I should try?  I'm working from home today
and don't have my Eagle book handy...

If I can't get it to work with name virtual hosts, I'll have to go to
port-based virtual hosts, which I'd prefer to avoid since I expect to
have several hundred of these eventually.

Thanks.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



$r->args()

2001-08-29 Thread Rasoul Hajikhani

Hello, 
I already have asked this question and got an answer for it, so please
accept my forwarded apologies. However, I was trying something else and
got stuck. I know in order to pass around query string, or form data,
pnotes may be used. However, I am trying something else and it does not
seem to work! 

.
.
.
$r = Apache::Request->new($r);
# check for some condition
if ($condition)
{
my $previous_uri= $r->param('previous_uri');

my $content = $r->param();

$r->method_number(M_GET);
$r->method('GET');

$r->headers_in->unset("Content-length");

$r->args($content);

$r->internal_redirect("$previous_uri");
}
.
.
.
However, in my called handler, no Post data can be read. Can any one
tell me why is that?
Any comments welcomed...
Thanks
-r



$r->args()

2001-08-29 Thread Rasoul Hajikhani

Hello, 
I already have asked this question and got an answer for it, so please
accept my forwarded apologies. However, I was trying something else and
got stuck. I know in order to pass around query string, or form data,
pnotes may be used. However, I am trying something else and it does not
seem to work! 

.
.
.
$r = Apache::Request->new($r);
# check for some condition
if ($condition)
{
my $previous_uri= $r->param('previous_uri');

my $content = $r->param();

$r->method_number(M_GET);
$r->method('GET');

$r->headers_in->unset("Content-length");

$r->args($content);

$r->internal_redirect("$previous_uri");
}
.
.
.
However, in my called handler, no Post data can be read. Can any one
tell me why is that?
Any comments welcomed...
Thanks
-r



Re: Apache, mod_perl

2001-08-29 Thread Randy Kobes

On Wed, 29 Aug 2001, H Jayakumar wrote:

> I have mod_perl and apache on NT.
>
> I want to add mod_perl as a module to apache,  I built mod_perl and
> got mod_perl.so.
> I have copied it to the modules directory in apache source tree.
>
> When I start apache, it says  :
>
> Syntax error on line 1049 of e:/apache/conf/httpd.conf:
> Cannot load e:/apache/modules/mod_perl.so into server:
>(126) The specified module could not be found:
>
> BUT the module mod_perl.so IS PRESENT IN THE above mentined path.
>
> This is line 1049 in e:/apache/conf/httpd.conf:
>
>LoadModule perl_module modules/mod_perl.so

As well as what Rod says in another reply about this message arising
from incompatible Apache/mod_perl versions, this can also be caused
from not having the perl executable in your PATH environment variable
when starting Apache.

best regards,
randy kobes





RE: Authen question

2001-08-29 Thread Geoffrey Young



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 28, 2001 2:25 PM
> To: [EMAIL PROTECTED]
> Subject: Authen question
> 
> 
> Hello
> 
> I want to know if there is a way to show a page or another to 
> some users
> depending in their logins.
> 
> I have two users poiting to the same URL. But I dont want 
> userA to see page
> B, and I dont want userB to see pageA.
> 

read up on the PerlAuthzHandler in the eagle book...

--Geoff



Re: Apache, mod_perl

2001-08-29 Thread Rod Butcher

This message has confused many people including me. It usually means that
the mod_perl binary is incompatible with your version of Apache. Most people
compile the whole lot together. Randy Kobes has kindly compiled mod_perl
binaries for recent Apache versions at
ftp://theoryx5.uwinnipeg.ca/pub/other/ppd/x86/
You can download the version of mod_perl that matches your version of Apache
and unzip it into the Apache module library. You can then look at the
compile options.
regards, Rod
===
This email message may contain the Ebola virus.
The sender is not responsible for any death, destruction,
reflux or tinitis that may result from reading this message.
The sender's lawyer forces him to write this crap.
- Original Message -
From: "H Jayakumar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 29, 2001 4:38 PM
Subject: Apache, mod_perl


I have mod_perl and apache on NT.

I want to add mod_perl as a module to apache,  I built mod_perl and got
mod_perl.so.
I have copied it to the modules directory in apache source tree.

When I start apache, it says  :

Syntax error on line 1049 of e:/apache/conf/httpd.conf:
Cannot load e:/apache/modules/mod_perl.so into server: (126) The specified
module could not be found:

BUT the module mod_perl.so IS PRESENT IN THE above mentined path.


This is line 1049 in e:/apache/conf/httpd.conf:

   LoadModule perl_module modules/mod_perl.so






Could anyone help, thanks