Wednesday, February 15, 2006
Bugs in Apache, Part II
Between restoring MySQL databases and dumping MySQL databases
I finally tracked down an
Apache bug from seven months ago (as it relates to mod_blog
). At the time, I was testing with Apache
2.0.54, but shortly thereafter Apache 2.0.55 was released and thinking that
it might have been addressed, I waited.
Okay, perhaps I waited a bit too long, but hey.
The problem still existed under Apache 2.0.55, and upon reporting it to the Apache Mailing List; a response came back—it might be similar to existing bug first reported on September 4th, 2003!
From: Joshua Slive <XXXXXXXXXXXXXXX>
To: Apache Mailing List <XXXXXXXXXXXXXXXXXXXXXX>
Subject: Re: [users@httpd] Odd interaction between mod_rewrite and mod_cgi
Date: Wed, 15 Feb 2006 11:48:24 -0500Sounds like:
http://issues.apache.org/bugzilla/show_bug.cgi?id=22898
In general, there are not many people insterested in nph scripts anymore, so I'd guess that little testing or debugging is done on them. They aren't useful for very much.
Ouch.
Then this rather amusing exchange took place:
From: Sean Conner <sean@conman.org>
To: Apache Mailing List <XXXXXXXXXXXXXXXXXXXXXX>
Subject: Re: [users@httpd] Odd interaction between mod_rewrite and mod_cgi
Date: Wed, 15 Feb 2006 15:21:04 -0500 (EST)Be that as it may, but is there some other way for a CGI script to return an HTTP status? That's primarily why I use the “nph-” feature (and no, rewriting the script in PHP is not an option).
From: Joshua Slive <XXXXXXXXXXXXXXX>
To: Apache Mailing List <XXXXXXXXXXXXXXXXXXXXXX>
Subject: Re: [users@httpd] Odd interaction between mod_rewrite and mod_cgi
Date: Wed, 15 Feb 2006 16:51:19 -0500Yes, there is a Status header, as in
Status: 404
From: Sean Conner <sean@conman.org>
To: Apache Mailing List <XXXXXXXXXXXXXXXXXXXXXX>
Subject: Re: [users@httpd] Odd interaction between mod_rewrite and mod_cgi
Date: Wed, 15 Feb 2006 17:07:13 -0500 (EST)Oh wow … I'll have to try that. Is it also available in Apache 1.3? (just on the off chance that you might know … )
From: Nick Kew <XXXXXXXXXXXXXXXXX>
To: Apache Mailing List <XXXXXXXXXXXXXXXXXXXXXX>
Subject: Re: [users@httpd] Odd interaction between mod_rewrite and mod_cgi
Date: Wed, 15 Feb 2006 22:24:36 +0000Of course. It's in every version of Apache.
More importantly, it's part of the CGI spec. That's something you should read.
Double ouch.
You see, in all the years I've had the code, I've never once read the CGI spec. The code I have is based off code from the old NCSA tutorial code. And when I needed to set the headers myself, I went through the Apache source code and found the “nph-” hack (probably back in the Apache 1.2 days).
And given that I still run Apache 1.3 …
Anyway.
I fixed mod_blog
to send the Status:
header and
it works as expected under both Apache 1.3 and Apache 2.0.
Life is good now.
Well, except for this stupid MySQL database migration.