You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Saurabh Soni <Sa...@mobiapps.com> on 2005/10/11 14:01:48 UTC

Apache 2.0.54+Perl5.8.7+mod_perl2.0.1 (win32) - Redirection problem

Hi,

I have a perl web-application on apache that needed upgrades for perl,
apache and mod_perl. I setup a server (win32) running Apache 2.0.54 with
perl 5.8.7 and mod_perl 2.0.1 (Randy Kobes win32 build), made the necessary
httpd.conf changes but got stuck at a redirection problem. The old perl code
uses CGI::Redirect to redirect to certain pages of the application from the
default page. This causes the server to go in an endless loop of redirects
to the same page until the following error message appears in error log.

 

[Tue Oct 04 16:27:42 2005] [error] [client 127.0.0.1] Request exceeded the
limit of 5 internal redirects due to probable configuration error. Use
'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel
debug' to get a backtrace., referer: http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2743): [client 127.0.0.1] r->uri =
/person/SYSADMIN/home, referer: http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2749): [client 127.0.0.1]
redirected from r->uri = /person/SYSADMIN/home, referer:
http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2749): [client 127.0.0.1]
redirected from r->uri = /person/SYSADMIN/home, referer:
http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2749): [client 127.0.0.1]
redirected from r->uri = /person/SYSADMIN/home, referer:
http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2749): [client 127.0.0.1]
redirected from r->uri = /person/SYSADMIN/home, referer:
http://localhost/search

[Tue Oct 04 16:27:42 2005] [debug] core.c(2749): [client 127.0.0.1]
redirected from r->uri = /home, referer: http://localhost/search

 

I have changed the "LimitInternalRecursion" directive a number of times in
httpd.conf but without any success. Has redirect in CGI v 3.11 been
deprecated? I have included Apache2::compat for compatibility purposed. Does
this error indicate that some modules referred in the old code are no longer
in use? Please advise.

 

Thanks & Regards,

Saurabh




Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
it.helpdesk@mobiapps.com

RE: Apache 2.0.54+Perl5.8.7+mod_perl2.0.1 (win32) - Redirection problem

Posted by Saurabh Soni <Sa...@mobiapps.com>.
Hi Randy/other experts,

I managed to fix the redirection problem. Following is a part of, what I
think, the offending script and its correction. The server seems to be
working fine now. I was changing the value of "location" when creating
header of the page in case of a redirect. This worked fine in Apache 1.3. I
have now explicitly used redirect call to redirect to another page in 2.0.

 

print $self->header(%HEADER, -location => self->{page_redirect});

 

Replaced by

 

print CGI::redirect(%HEADER, -location=> $self->{page_redirect});

 

Thanks for your help and support

Regards,

Saurabh

 

-----Original Message-----
From: Randy Kobes [mailto:randy@theoryx5.uwinnipeg.ca] 
Sent: Friday, October 14, 2005 2:51 AM
To: Saurabh Soni
Cc: modperl@perl.apache.org
Subject: Re: Apache 2.0.54+Perl5.8.7+mod_perl2.0.1 (win32) - Redirection
problem

 

On Tue, 11 Oct 2005, Saurabh Soni wrote:

 

> Hi,

> 

> I have a perl web-application on apache that needed upgrades for perl,

> apache and mod_perl. I setup a server (win32) running Apache 2.0.54 with

> perl 5.8.7 and mod_perl 2.0.1 (Randy Kobes win32 build), made the
necessary

> httpd.conf changes but got stuck at a redirection problem. The old perl
code

> uses CGI::Redirect to redirect to certain pages of the application from
the

> default page. This causes the server to go in an endless loop of redirects

> to the same page until the following error message appears in error log.

 

Can you give a minimal example script or handler that

exhibits this behaviour? I tried the following script:

========================================================

#!D:/Perl/bin/perl

# called as http://localhost/perl/redirect

use strict;

use CGI qw(redirect);

print redirect('http://localhost/perl/printenv');

========================================================

run under ModPerl::Registry, and it worked fine.

This is with CGI.pm version 3.10.

 

-- 

best regards,

randy kobes

 




Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
it.helpdesk@mobiapps.com

Re: Apache 2.0.54+Perl5.8.7+mod_perl2.0.1 (win32) - Redirection problem

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 11 Oct 2005, Saurabh Soni wrote:

> Hi,
>
> I have a perl web-application on apache that needed upgrades for perl,
> apache and mod_perl. I setup a server (win32) running Apache 2.0.54 with
> perl 5.8.7 and mod_perl 2.0.1 (Randy Kobes win32 build), made the necessary
> httpd.conf changes but got stuck at a redirection problem. The old perl code
> uses CGI::Redirect to redirect to certain pages of the application from the
> default page. This causes the server to go in an endless loop of redirects
> to the same page until the following error message appears in error log.

Can you give a minimal example script or handler that
exhibits this behaviour? I tried the following script:
========================================================
#!D:/Perl/bin/perl
# called as http://localhost/perl/redirect
use strict;
use CGI qw(redirect);
print redirect('http://localhost/perl/printenv');
========================================================
run under ModPerl::Registry, and it worked fine.
This is with CGI.pm version 3.10.

-- 
best regards,
randy kobes