Tag Archives: apache

Dion

I found out today that Dion Gillard is having some rather serious medical problems. I’ve thought quite often lately about the aging of the population of the Apache Software Foundation. We’re not 21 any more, although there’s a steady supply of new participants that arrive for the party every day.

Dion has been around since almost the beginning, having been part of the Jakarta project since it started. I’ve only met him a few times, although I’m sure we’ve attended the same conferences for years.

Dion, our prayers are with you as you struggle against this. As you said, positive attitude is everything, and, hey, you helped make Jakarta happen, so you’re practically guaranteed to succeed! 🙂

mod_substitute

As of 2.2.8, there’s a new module that comes standard with Apache HTTPd called mod_substitute. As soon as I upgraded to 2.2.8, I found an immediate use for mod_substitute.

mod_substitute lets you apply a regular expression to change data as it gets sent out to the client. Another module, mod_line_edit, has been around for a while and also does this. This is the first time it’s been part of the standard Apache distro.

We’re using TinyMCE to edit content on our website. Turns out that Internet Explorer doesn’t honor align=”left” and align=”right” on images, so we had to stick in style=”float: left” and style=”float: right” instead. But getting TinyMCE to do this was difficult since I don’t speak JavaScript fluently enough to make it do that. We created a class “float-left” and another “float-right” for this.

So, using mod_substitute, I did:

<Location />
AddOutputFilterByType SUBSTITUTE text/html
Substitute “s!(<img)(class=”float-(left|right)”)?([^>]*?)align=”(left|right)”([^>]*?)(class=”float-(right|left)”)?([^>]*>)!$1$4align=”$5″ class=”float-$5″$6$9!i”
</Location>

Yes, that’s more complicated than it should be, because once you start editing and re-editing, the class=”float-*” ends up in the edited HTML, and we have to take it back off again. Sheesh.

But, that’s not all. When we load the content back into the editor, we have to take all that stuff off:

<LocationMatch (/admin/pages.php|/press/edit)>
AddOutputFilterByType SUBSTITUTE text/html
Substitute “s!<(img.*?)class=”float-(left|right)”(.*?)>!<$1$3>!i”
</LocationMatch>

Cool, hmm?

Right place at the right time

Jim blogged about the PHP credits list, and so I took a look. I was amazed to notice that of all the people listed, I know at least half of them, and have met most of the others. I’ve been very lucky to be in the right place at the right time, and meet some amazing people, and get associated with a pretty amazing organization, and by extension, a bunch of others.

In the early days, when the term Open Source wasn’t quite as well known as it is now, I managed to meet a significant number of the folks responsible for Perl, and become friends with several of them. A few years later I started spending more time with Apache than with Perl, and that’s developed into speaking opportunities, books, interesting projects – but most importantly and lastingly, a bunch of friends.

Every now and then, I get a glimpse of just how lucky I’ve been over the last ten years, and the truly astonishing opportunities that have been available to me by virtue just being in the right place, and being willing to volunteer a little of my time.

I’ve been less involved for the last year, since there’s somewhere that my attention has needed to be focused. I’m gradually getting back into spending time on Apache things, but it’s given me some time to think about where I want to spend the few cycles that I have, and I expect that my involvement will be a little different from what it’s been in the past.

But time will tell.

APC

Add another one to the list of things that I’ve put off for a long time, only to realize that they’re simple to do, and have a great pay-off.

Today I installed and enabled APC, which immediately doubled the speed of my PHP applications. And, more importantly, the load on the server immediately dropped by a factor of 10.

I understand that there are other php caching accelerating thingies out there, and I expect that everyone has their opinion of which one is the best. But I’m very impressed with APC.

Apache Cookbook 2

In the mail today I received my shipment of Apache Cookbook, 2nd Edition. It’s got a bunch of new recipes, and all the rest of them have been updated for the 2.2 version of the Apache Web Server. You owe it to yourself to go buy a copy now. Go ahead. We’ll wait.

Meanwhile I’d like to share my dedication:

I dedicate this book to the experts on #apache who answer so many of these questions every day, and to their beginners, on their way to becoming experts, who ask them.

A huge thank you goes to all the many people involved in making this book a reality. Tatiana, thank you for your patience and persistent assistance throughout this process.

And, finally, thanks go to my wonderful family. To Sarah, who always looks for my books at the bookstore. To Isaiah, for all his boundless energy and tight hugs. And to my Best Beloved, for helping me discover so much Pointless Beauty.