httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruud Dozijn <rdoz...@hotmail.com>
Subject [users@httpd] apache adds extra HTML to an error page
Date Mon, 09 Jul 2012 15:04:07 GMT

hello list,

I am trying to migrate a perl script that acts as a webserver from solaris to linux (red hat).
The script is run using apache (httpd) and mod_perl.

It nearly does what it is supposed to, exept for the error pages.
When an error occurs and the script can not fulfill the request, it sends a small error page
to the user, containing two p elements, together with status 500.

This used to work OK, but on the new machine, apache decides to add extra text to the page.
The receiving application sees a page that does not conform to the specification and thinks
it is not an error page. This results in various problems.

I have not the slightest idea in what direction I have to search. Is it an apache configuration
issue or maybe a perl library issue? I really don't know.
Can you guys give me some clue?

This is the perl code that makes the error page:

    print $cgi->header (  -status => '500 NOT OK',

                                        -type   => 'text/html');
    print $cgi->start_html ('agent');
    print $cgi->p ('ERROR');
    print $cgi->p ('error during database lookup');
    print $cgi->end_html ();

And this is what I receive in my browser:
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

<head>

<title>agent</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

</head>

<body><p>ERROR</p>
<p>error during database lookup</p>
</body>
</html>
<!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,
 webmaster@sdu.nl 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>

</body>
</html>

thanks in advance, Ruud
 		 	   		  
Mime
View raw message