The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

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 -0500

Sounds 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 -0500

Yes, 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 +0000

Of 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.

Obligatory Picture

Trying to get into the festive mood this year

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

Obligatory AI Disclaimer

No AI was used in the making of this site, unless otherwise noted.

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site: https://boston.conman.org/, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

https://boston.conman.org/2000/08/01

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.