You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Charles Randall <cr...@matchlogic.com> on 2001/08/30 00:14:39 UTC
2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Using the prefork mpm on FreeBSD 4.2-R with a default installation
(./configure --prefix=/my/full/path -with-port=8080) a request for a
non-existant page (E.g., /bogus) returns the HTML error document as
text/plain.
The headers returned from the server are,
HTTP/1.1 404 Not Found
Date: Wed, 29 Aug 2001 22:11:19 GMT
Server: Apache/2.0.25 (Unix)
Vary: accept-language
Accept-Ranges: bytes
Content-Length: 744
Connection: close
Content-Type: text/plain; charset=ISO-8859-1
Expires: Wed, 29 Aug 2001 22:11:19 GMT
I haven't tried to reproduce this on other platforms.
As a side note, some portions of the code are compiled with "-D_REENTRANT
-D_THREAD_SAFE" even when building using the prefork mpm. Why? Doesn't that
have the potential to do the wrong thing on some platforms?
Charles
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error
page
Posted by Roman Neuhauser <ne...@mail.cz>.
At 00:41 8/30/2001, William A. Rowe, Jr. wrote the following:
--------------------------------------------------------------
>From: "Justin Erenkrantz" <je...@ebuilt.com>
>To: <de...@httpd.apache.org>
>Sent: Wednesday, August 29, 2001 5:24 PM
>Subject: Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
>
>
>> On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
>> > Using the prefork mpm on FreeBSD 4.2-R with a default installation
>> > (./configure --prefix=/my/full/path -with-port=8080) a request for a
>> > non-existant page (E.g., /bogus) returns the HTML error document as
>> > text/plain.
>>
>> Yup, that's a bug. I don't *think* it is a showstopper though. I can
>> reproduce this here. I was just looking to not have the 506 error -
>> I didn't even pay attention to the content-type returned.
>
>Outch. But if we were mis-parsing the .var file due to the apr_file_seek
>and apr_file_gets implementations, then this could be expected.
>
>I'll try reproducing on Win32.
>
>[Dang me for testing with IE! Mozilla from now on, promise!!! Whatever
>happened to that little 'show http headers' feature from Mozilla .91???]
c:\temp> wget -S --spider http://etc/
:)
__________________________________________________
Roman Neuhauser
neuhauser@mail.cz
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Netcat 1.1 usually does fine for me, but I'm usually looking at whole content,
not just headers :( It was kind of handy when the lat Mozilla offered that
panel... now I dunno where it's disappeared to.
----- Original Message -----
From: "Jerry Baker" <je...@weirdness.com>
To: <de...@httpd.apache.org>
Sent: Wednesday, August 29, 2001 8:06 PM
Subject: Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
> "William A. Rowe, Jr." wrote:
> >
> > I'll try reproducing on Win32.
> >
> > [Dang me for testing with IE! Mozilla from now on, promise!!! Whatever
> > happened to that little 'show http headers' feature from Mozilla .91???]
>
> I dunno, but I have a tiny little VB utility to get HTTP headers without
> having to do the whole telnet thing. Lemme know if you want it.
>
> --
> Jerry Baker
>
> PGP Key: http://www.jerrybaker.org/pgp.html
>
> LAME MP3 Encoder Binaries: http://www.jerrybaker.org/lame/
> Apache 2.0 Web server Installer: http://www.jerrybaker.org/apache/
>
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Jerry Baker <je...@weirdness.com>.
"William A. Rowe, Jr." wrote:
>
> I'll try reproducing on Win32.
>
> [Dang me for testing with IE! Mozilla from now on, promise!!! Whatever
> happened to that little 'show http headers' feature from Mozilla .91???]
I dunno, but I have a tiny little VB utility to get HTTP headers without
having to do the whole telnet thing. Lemme know if you want it.
--
Jerry Baker
PGP Key: http://www.jerrybaker.org/pgp.html
LAME MP3 Encoder Binaries: http://www.jerrybaker.org/lame/
Apache 2.0 Web server Installer: http://www.jerrybaker.org/apache/
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Justin Erenkrantz" <je...@ebuilt.com>
To: <de...@httpd.apache.org>
Sent: Wednesday, August 29, 2001 5:24 PM
Subject: Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
> On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> > Using the prefork mpm on FreeBSD 4.2-R with a default installation
> > (./configure --prefix=/my/full/path -with-port=8080) a request for a
> > non-existant page (E.g., /bogus) returns the HTML error document as
> > text/plain.
>
> Yup, that's a bug. I don't *think* it is a showstopper though. I can
> reproduce this here. I was just looking to not have the 506 error -
> I didn't even pay attention to the content-type returned.
Outch. But if we were mis-parsing the .var file due to the apr_file_seek
and apr_file_gets implementations, then this could be expected.
I'll try reproducing on Win32.
[Dang me for testing with IE! Mozilla from now on, promise!!! Whatever
happened to that little 'show http headers' feature from Mozilla .91???]
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Joshua Slive <jo...@slive.ca>.
On Wed, 29 Aug 2001, Greg Stein wrote:
> On Wed, Aug 29, 2001 at 06:01:35PM -0700, Marc Slemko wrote:
> > On Wed, 29 Aug 2001, Justin Erenkrantz wrote:
> > > On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> > > > Using the prefork mpm on FreeBSD 4.2-R with a default installation
> > > > (./configure --prefix=/my/full/path -with-port=8080) a request for a
> > > > non-existant page (E.g., /bogus) returns the HTML error document as
> > > > text/plain.
> > >
> > > Yup, that's a bug. I don't *think* it is a showstopper though. I can
> >
> > Erm... it is a showstopper from making it beta, that's for sure.
>
>
> No big deal. Let's release it as an alpha.
>
This is a problem simply with the multi-language error-docs. If you want
to go beta, just comment them out of the default config file. I doubt
very much else will be hit by this problem.
Joshua.
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Greg Stein <gs...@lyra.org>.
On Wed, Aug 29, 2001 at 06:01:35PM -0700, Marc Slemko wrote:
> On Wed, 29 Aug 2001, Justin Erenkrantz wrote:
> > On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> > > Using the prefork mpm on FreeBSD 4.2-R with a default installation
> > > (./configure --prefix=/my/full/path -with-port=8080) a request for a
> > > non-existant page (E.g., /bogus) returns the HTML error document as
> > > text/plain.
> >
> > Yup, that's a bug. I don't *think* it is a showstopper though. I can
>
> Erm... it is a showstopper from making it beta, that's for sure.
No big deal. Let's release it as an alpha.
Cheers,
-g
--
Greg Stein, http://www.lyra.org/
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Marc Slemko <ma...@znep.com>.
On Wed, 29 Aug 2001, Justin Erenkrantz wrote:
> On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> > Using the prefork mpm on FreeBSD 4.2-R with a default installation
> > (./configure --prefix=/my/full/path -with-port=8080) a request for a
> > non-existant page (E.g., /bogus) returns the HTML error document as
> > text/plain.
>
> Yup, that's a bug. I don't *think* it is a showstopper though. I can
Erm... it is a showstopper from making it beta, that's for sure.
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> Using the prefork mpm on FreeBSD 4.2-R with a default installation
> (./configure --prefix=/my/full/path -with-port=8080) a request for a
> non-existant page (E.g., /bogus) returns the HTML error document as
> text/plain.
Yup, that's a bug. I don't *think* it is a showstopper though. I can
reproduce this here. I was just looking to not have the 506 error -
I didn't even pay attention to the content-type returned.
> As a side note, some portions of the code are compiled with "-D_REENTRANT
> -D_THREAD_SAFE" even when building using the prefork mpm. Why? Doesn't that
> have the potential to do the wrong thing on some platforms?
Yeah, well, I'm trying to get FreeBSD to work with threading. At
this point it doesn't even work with threading, so you could remove
those flags, but I do hope to try and get it working soon. -- justin
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "Roy T. Fielding" <fi...@ebuilt.com>.
> As a side note, some portions of the code are compiled with "-D_REENTRANT
> -D_THREAD_SAFE" even when building using the prefork mpm. Why? Doesn't that
> have the potential to do the wrong thing on some platforms?
No, it would do the wrong thing if they were not defined. They are required
for the entire executable if any part of the exec has been compiled with
those flags. In our case, since modules like PHP and others will be
compiled with those flags, we must always compile with those flags or
mod_php's return values for errno won't be correctly interpreted by
the httpd core (a problem that was fixed in some version of 1.3.x by
always setting those flags on platforms that support it).
....Roy
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "William A. Rowe, Jr." <wr...@rowe-clan.net>
Sent: Wednesday, August 29, 2001 10:49 PM
> From: "Justin Erenkrantz" <je...@ebuilt.com>
> Sent: Wednesday, August 29, 2001 10:29 PM
>
> > On Wed, Aug 29, 2001 at 08:20:38PM -0700, Justin Erenkrantz wrote:
> > > HEAD looks like it has this problem fixed (the buffered read fixes
> > > perhaps?). Please check it out and see if it works for you with
> > > the latest CVS.
> >
> > No, it's not fixed. My bad.
> >
> > I had a stale config which had SetOutputFilter instead of
> > AddOutputFilter for the error pages. What does SetOutputFilter
> > do that AddOutputFilter doesn't?
> >
> > I'm drilling down to see what's up. -- justin
>
> Nothing that Apache hasn't done forever (incorrectly) :(
>
> Patch in 3 minutes.
Committed.
Essentially, we used AddOutputFilter includes >html<, which broke mime.
It's done this forever, but it wasn't common ... how often did you set the
Encoding, Charset, Language or Handler on 'html'? If you did - you broke
(unless you added a _corresponding_ AddType text/html >html<.
We just skipped the mime.types file altogether since the .html record was
found in the extension info within the /serverroot/error/ directory block,
having set AddOutputFilter. This would have been reported frequently with
these two new filtering directives.
Bill
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Pretty danged close :) Good job (probably would have lost the race I hadn't
just memorized every line of that code in the last two weeks ;)
We really can skip it if exinfo->forced_type is set, though. That overrides
all other mime types.
Bill
----- Original Message -----
From: "Justin Erenkrantz" <je...@ebuilt.com>
To: <de...@httpd.apache.org>
Sent: Wednesday, August 29, 2001 11:02 PM
Subject: Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
> On Wed, Aug 29, 2001 at 10:49:31PM -0500, William A. Rowe, Jr. wrote:
> > From: "Justin Erenkrantz" <je...@ebuilt.com>
> > Sent: Wednesday, August 29, 2001 10:29 PM
> >
> >
> > > On Wed, Aug 29, 2001 at 08:20:38PM -0700, Justin Erenkrantz wrote:
> > > > HEAD looks like it has this problem fixed (the buffered read fixes
> > > > perhaps?). Please check it out and see if it works for you with
> > > > the latest CVS.
> > >
> > > No, it's not fixed. My bad.
> > >
> > > I had a stale config which had SetOutputFilter instead of
> > > AddOutputFilter for the error pages. What does SetOutputFilter
> > > do that AddOutputFilter doesn't?
> > >
> > > I'm drilling down to see what's up. -- justin
> >
> > Nothing that Apache hasn't done forever (incorrectly) :(
> >
> > Patch in 3 minutes.
>
> Let's see how close I am. I think it has something to do with this
> logic. We should always look in mime_type_extensions, or so I
> think...
>
> A complete shot-in-the-dark... I feverishly await your commit.
> -- justin
>
> Index: mod_mime.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c,v
> retrieving revision 1.60
> diff -u -r1.60 mod_mime.c
> --- mod_mime.c 2001/08/28 15:31:08 1.60
> +++ mod_mime.c 2001/08/30 04:00:04
> @@ -740,14 +740,11 @@
> ext, APR_HASH_KEY_STRING);
> }
>
> - if (exinfo == NULL) {
> - if ((type = apr_hash_get(mime_type_extensions, ext,
> - APR_HASH_KEY_STRING)) != NULL) {
> - r->content_type = type;
> - found = 1;
> - }
> + if ((type = apr_hash_get(mime_type_extensions, ext,
> + APR_HASH_KEY_STRING)) != NULL) {
> + r->content_type = type;
> }
> - else {
> + if (exinfo != NULL) {
>
> if (exinfo->forced_type) {
> r->content_type = exinfo->forced_type;
>
>
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Aug 29, 2001 at 10:49:31PM -0500, William A. Rowe, Jr. wrote:
> From: "Justin Erenkrantz" <je...@ebuilt.com>
> Sent: Wednesday, August 29, 2001 10:29 PM
>
>
> > On Wed, Aug 29, 2001 at 08:20:38PM -0700, Justin Erenkrantz wrote:
> > > HEAD looks like it has this problem fixed (the buffered read fixes
> > > perhaps?). Please check it out and see if it works for you with
> > > the latest CVS.
> >
> > No, it's not fixed. My bad.
> >
> > I had a stale config which had SetOutputFilter instead of
> > AddOutputFilter for the error pages. What does SetOutputFilter
> > do that AddOutputFilter doesn't?
> >
> > I'm drilling down to see what's up. -- justin
>
> Nothing that Apache hasn't done forever (incorrectly) :(
>
> Patch in 3 minutes.
Let's see how close I am. I think it has something to do with this
logic. We should always look in mime_type_extensions, or so I
think...
A complete shot-in-the-dark... I feverishly await your commit.
-- justin
Index: mod_mime.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c,v
retrieving revision 1.60
diff -u -r1.60 mod_mime.c
--- mod_mime.c 2001/08/28 15:31:08 1.60
+++ mod_mime.c 2001/08/30 04:00:04
@@ -740,14 +740,11 @@
ext, APR_HASH_KEY_STRING);
}
- if (exinfo == NULL) {
- if ((type = apr_hash_get(mime_type_extensions, ext,
- APR_HASH_KEY_STRING)) != NULL) {
- r->content_type = type;
- found = 1;
- }
+ if ((type = apr_hash_get(mime_type_extensions, ext,
+ APR_HASH_KEY_STRING)) != NULL) {
+ r->content_type = type;
}
- else {
+ if (exinfo != NULL) {
if (exinfo->forced_type) {
r->content_type = exinfo->forced_type;
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Justin Erenkrantz" <je...@ebuilt.com>
Sent: Wednesday, August 29, 2001 10:29 PM
> On Wed, Aug 29, 2001 at 08:20:38PM -0700, Justin Erenkrantz wrote:
> > HEAD looks like it has this problem fixed (the buffered read fixes
> > perhaps?). Please check it out and see if it works for you with
> > the latest CVS.
>
> No, it's not fixed. My bad.
>
> I had a stale config which had SetOutputFilter instead of
> AddOutputFilter for the error pages. What does SetOutputFilter
> do that AddOutputFilter doesn't?
>
> I'm drilling down to see what's up. -- justin
Nothing that Apache hasn't done forever (incorrectly) :(
Patch in 3 minutes.
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Aug 29, 2001 at 08:20:38PM -0700, Justin Erenkrantz wrote:
> HEAD looks like it has this problem fixed (the buffered read fixes
> perhaps?). Please check it out and see if it works for you with
> the latest CVS.
No, it's not fixed. My bad.
I had a stale config which had SetOutputFilter instead of
AddOutputFilter for the error pages. What does SetOutputFilter
do that AddOutputFilter doesn't?
I'm drilling down to see what's up. -- justin
Re: 2.0.25 on FreeBSD 4.2-R -- 404 returns text/plain error page
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Aug 29, 2001 at 04:14:39PM -0600, Charles Randall wrote:
> The headers returned from the server are,
>
> HTTP/1.1 404 Not Found
> Date: Wed, 29 Aug 2001 22:11:19 GMT
> Server: Apache/2.0.25 (Unix)
> Vary: accept-language
> Accept-Ranges: bytes
> Content-Length: 744
> Connection: close
> Content-Type: text/plain; charset=ISO-8859-1
> Expires: Wed, 29 Aug 2001 22:11:19 GMT
>
> I haven't tried to reproduce this on other platforms.
HEAD looks like it has this problem fixed (the buffered read fixes
perhaps?). Please check it out and see if it works for you with
the latest CVS.
If this looks good, let's tag 2.0.26 ASAP. -- justin