Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

December 18, 2005

That’s Better!

After considerable frustration with Apache 2.2.0, I was about to throw in the towel and downgrade to 2.0.55. On a lark, I decided to download the latest Development Version and try that instead.

Amazingly … it works!

No longer do child httpd processes go berserk after a while, and start hogging all the available CPU time. Instead, individual httpd processes barely ever rise as high as 0.1% of a single CPU when actively serving pages. Which is the way it’s supposed to work. So I’m now (more or less) happily running Apache/2.3.0-dev.

Let’s review: Apache 2.2.0 is broken and unusable on MacOSX 10.4; the current Development snapshot (from barely 2 weeks after the 2.2.0 release) works just fine. After the previous debacle of Apache 2.0.x (for x<55) being utterly broken on MacOSX 10.4, I begin to get the impression that no one, either at the Apache Foundation or at Apple, actually tests them together before release.

“Smart” Filters

Anyway, now that’s out of the way, we can turn to my next “Huh?” moment with the new Apache release.

Some of my pages use server-side includes. I also use mod_deflate to send out my pages compressed, thereby saving bandwidth while speeding them on their way to you, dear reader. The configuration code to do this is very simple.

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddOutputFilterByType DEFLATE text/html text/plain \ application/rss+xml application/atom+xml \ application/xhtml+xml application/xml \ application/postscript image/svg+xml

But Apache 2.2 comes with a new, improved, filtering architecture, mod_filter. And what do they have to say about AddOutputFilterByType?

One further directive AddOutputFilterByType is still supported, but may be problematic and is now deprecated. Use dynamic configuration instead.

Deprecated, eh?

OK … Let’s figure out how to do this the “right” way. Something like


AddType text/html .shtml
AddHandler server-parsed .shtml
FilterDeclare SSI
FilterProvider SSI INCLUDES Handler server-parsed
FilterDeclare COMPRESS FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain FilterProvider COMPRESS DEFLATE resp=Content-Type /application\/.*xml/ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/postscript FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml FilterProtocol COMPRESS change=yes
FilterChain SSI COMPRESS

Except that doesn’t actually work.

Well … it works OK on non-SSI pages. But SSI pages, like the main page of this blog, involve internal subrequests, and they get hopelessly spooged by the above filter-chain.

So maybe some Apache maven can explain how the wizzy new smart filtering technology is supposed to accomplish this garden-variety task? Or, better yet, maybe they could add such an explanation to the f#@%ing documentation!

Posted by distler at December 18, 2005 1:03 AM

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/703

1 Comment & 0 Trackbacks

Re: That’s Better!

Actually, several of the core developers tested httpd 2.2.0 on OS X 10.4. I am running it right now, and use it as my primary development machine.

I haven’t seen the specific bug you mention, but thanks for opening a bug report in bugzilla. Hopefully we can figure out what is going on and fix it.

It is very odd that 2.3-dev works correctly for you, while 2.2.0 does not. There is very very little difference between the two.

-Paul

Posted by: Paul Querna on December 18, 2005 12:34 PM | Permalink | Reply to this

Post a New Comment