You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tracy12 <j_...@yahoo.com> on 2007/01/09 01:54:00 UTC

The server encountered an internal error

Hi,

I have a simple httpd.conf block as follows

<Location /goto>
SetHandler perl-script
PerlHandler AuthCAS->test_Method2
</Location>

within my perl module (inside test_Method2) I have simple re direct as
follows

sub test_Method2 {
my $urlNew = "www.mail.yahoo.com";
printf "Location: $urlNew\n\n";

}


When I hit a URL like http://localhost/goto

It hits the test_Method2 method  but a page displays with the following
content

Location: www.mail.yahoo.com

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.0 (Fedora) Server at localhost Port 80</address>
</body></html>


What I am I missing?



-- 
View this message in context: http://www.nabble.com/The-server-encountered-an-internal-error-tf2943206.html#a8230053
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: The server encountered an internal error

Posted by Michael Peters <mp...@plusthree.com>.

Tracy12 wrote:
[snip]

> <p>More information about this error may be available
> in the server error log.</p>
> <hr>
> <address>Apache/2.2.0 (Fedora) Server at localhost Port 80</address>
> </body></html>
> 
> 
> What I am I missing?

The line above says to check the error logs on the server. "tail -f" is your friend.

-- 
Michael Peters
Developer
Plus Three, LP


Re: The server encountered an internal error

Posted by Perrin Harkins <pe...@elem.com>.
On Mon, 2007-01-08 at 16:54 -0800, Tracy12 wrote:
> within my perl module (inside test_Method2) I have simple re direct as
> follows
> 
> sub test_Method2 {
> my $urlNew = "www.mail.yahoo.com";
> printf "Location: $urlNew\n\n";

Just use print here, not printf.

> It hits the test_Method2 method  but a page displays with the following
> content
> 
> Location: www.mail.yahoo.com
> 
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>200 OK</title>

You need to return the correct constant from your handler.  Take a look
at the sample code here:
http://perl.apache.org/docs/2.0/user/coding/cooking.html#Sending_Cookies_in_REDIRECT_Response__handlers_

- Perrin