Tomcat at ApacheCon

Tomcat is one of the oldest members of the Apache family, and one of the standard building blocks of the web as we know it today. It can sometimes fall below the radar, because it just works, so most folks are completely unaware of it.

Filip Hanik will be doing a training class on Tomcat at ApacheCon this year. I spoke with him last week for Feathercast, and I’ve finally edited it. You can listen here, or come to ApacheCon and hear him there.

Apache HTTP Server – Nuts to Bolts

ApacheCon is just a few weeks away. Jim and I are doing our Nuts to Bolts training class again, with all new content, because of all the cool new stuff that has gone in to Apache over the last year. Don’t miss it!

A two-day training covering everything you need to know to administer an Apache HTTP Server.

Day one, led by Jim Jagielski, give the overview of the server, showing you the core architecture of the server, how the modular nature of the server works, and shows you the most important of the modules. You’ll learn how to install the server, how to configure it, secure it, and performance-tune it.

Day two, led by Rich Bowen, takes a more hands-on, recipe driven approach. You’ll learn how to accomplish common tasks, install third party modules, and troubleshoot common problems. Examples are taken from questions often asked on the support mailing lists and IRC channels.

Jim and Rich have both been working with the Apache HTTP Server for more than ten years, and have both taught training classes for many of those years.

Women in Open Source

I’ve been thinking about the topic of women in open source for quite some time. For context, the percentage of women in IT is about 20%, and the percentage of women in open source is about 1.5%. For larger context, read Skud’s OSCon keynote, because she is *way* better at articulating it than I am.

Which brings me to my point.

The women I know in open source are way above average. By which I mean, quite simply, that almost all of them make me feel stupid by comparison.

Now, I don’t consider myself a genius, but I also know that I’m no dunce. I’ve written 13 books. I can read several languages, and make myself understood in one or two of them. I have a masters degree in mathematics. I’m no slouch.

But then I look at people like Skud, Allison Randall, Noirin Shirley, and Elizabeth Naramore, among others, and feel like maybe I should have paid more attention in school.

But, see, if I look around all of the Open Source projects that I’m involved with, *all* of the women are this caliber. There are no average or below-average women in Open Source, it seems. Which makes me look at some of Skud’s statistics, and wonder.

Sure, men are unaware of the problem, because they look around and see these amazingly talented women working with them, and figure, how can there be a problem.

But that seems to only highlight the problem. Why’s that? Well, apparently, when you’re a woman, you have to be amazing just to get past all of the old-boys-club and macho chauvinism that pervades the entire Open Source culture. Granted, this is less true in some corners of the kingdom than others, but it’s pretty prevalent where I live.

I remember riding up to my hotel room (at a conference) in an elevator with my wife, and a PHP developer who, fortunately, I don’t know the name of, wearing a shirt that was so profoundly offensive and degrading to women that it was all I could do to not make him apologize right there. Perhaps I should have. And that’s certainly not a one-off anecdote.

Now, I don’t pretend to know what the solution is. But I think that a good way to start is reading Skud’s presentation, and not wearing shirts like that – not only at conferences, but ever. Until we men adjust our attitudes about women, we’re going to perpetuate this problem – even if we refuse to acknowledge that it’s a problem.

vim: *.asp = perl

Useful .vimrc entries for today. Working a project where the files are named *.asp, presumably for historical reasons, but are actually Perl. Thus:

syntax on
filetype on
au BufNewFile,BufRead *.asp set filetype=perl

FallbackResource

There’s a new directive in mod_dir, and I’m very pleased about it, because it’s something that we’ve wanted for a long time, and which a LOT of people will benefit from. The directive is called FallbackResource, and is documented here.

Many web applications use the concept of a “front controller”, which means that every incoming request is mapped to a single script/handler/program that determines what needs to be done based on the URI. There’s some kind of an internal URL parsing mechanism that takes the action and arguments from the URI and sends it to the correct function or controller to produce output.

In order to produce this effect, there needs to be some kind of rewrite that sends all requests to that front controller. Something like this:

RewriteEngine On
RewriteRule (.*) index.php

Then, when the URI /foo/bar is requested, that gets sent to index.php, which, in turn, looks at the variable REQUEST_URI (‘/foo/bar’) and figures out what to do.

The trouble with this approach is that actual file resources, like ‘my_logo.jpg’ and ‘style.css’ also get sent to index.php, so we have to take steps to avoid that happening:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php

-f and -d are rewrite-speak for “is a file” and “is a directory”, respectively. So this says “if it’s not a file, and not a directory, do the rewrite.”

A lot of web app projects use a rewrite ruleset exactly like this one. WordPress does. CakePHP does. Drupal and Habari and Django, and lots of other things do. Unfortunately, many of them get it horribly wrong, or, sometimes, just sufficiently wrong to make it hard to troubleshoot. And WordPress famously had a 72-line version of this at one point. Fortunately, they fixed that several years ago.

But even that isn’t enough, because sometimes you have Aliases that need to be explicitly avoided, and you’ll need to list those, too:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(pony|server-status|server-info|icons)
RewriteRule (.*) index.php

And, of course, you may have other rewrite rules for other things on your site. And with added complexity comes added fragility, so there’s greater chance of breaking something, or just getting confused.

All of the above is now replaced by one directive:

FallbackResource index.php

That’s all. It says “if a request doesn’t map to something, send it to index.php.”

This directive is in trunk, and so will be in the 2.3/2.4 release. I don’t know if it will get backported to 2.2.

The Margin Is Too Narrow