rdozijn at hotmail
Jul 10, 2012, 1:53 AM
Post #3 of 4
oops, sent reply to individual user instead of list...
RE: apache adds extra HTML to an error page
[In reply to]
> ------------ Original Message ------------
> > Date: Monday, July 09, 2012 05:04:07 PM +0200
> > From: Ruud Dozijn <rdozijn [at] hotmail>
> > To: users [at] httpd
> > Subject: [users [at] http] apache adds extra HTML to an error page
> > 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?
> ... snip
> > thanks in advance, Ruud
> You're getting the (apache) server-default error message. You can
> control what is delivered by taking control of the error code in the
> httpd,conf file and/or the error file proper (on RHEL that's
> generally in /var/www/error).
> To take control of an error code, uncomment it in the httpd.conf and
> supply an action -- file/script/etc. I think the 404 code has better
> examples in that file than do the 5xx ones.
> - Richard
The response I mentioned is indeed made by apache and not by my browser. I have the same result when I do a post request without using a browser.
I think Richard is right about getting a server-default error message.
My first reaction would be to swich off the server-default error message. I don't want the status OR the html to be changed at all.
Is that possible in my local httpd.conf? Where is the behaviour set that gives the extended error message?
I suppose I can supply an empty ErrorDocument in my httpd.conf, but this seems a dirty solution to me.
Moreover, the response I get now is changed from 500 to 200. And that is the primary source of the problems: the receiving process first looks at the status code and parses the html when it is NOT 200. So in the current situation, the receiver thinks everyting is OK due to the changed status code.