Thanks for the great reply, Geoff. Sorry I didn't get back to you sooner. I've ben snorkeling for the last week. :-)

On May 11, 2004, at 5:19 PM, Geoffrey Young wrote:

well, not really :)

that's the way it would work with apache 1.3, except that ClearModuleList
unloads everything, so you now need an AddModule for every module, including
mod_cgi, mod_rewrite, mod_auth, etc.

Oh, too bad there isn't a RemoveModule. Then I could just do:

  RemoveModule mod_dir.c
  AddModule mod_dir.c

Oh, well!

outside of that, mod_dir needs to go last, which would give it a higher
priority. it's the same as when you do httpd -l to list static modules -
modules at the bottom of the list get first dibs at the request. you'll see
mod_perl at the bottom, which is generally what we want but what is causing
you grief at the moment.

Right, gotcha.

but outside of those caveats, yes. giving mod_dir a higher priority will
mean that apache calls it first for every phase that mod_dir enters. for
the content generation phase, mod_dir will run and return OK and apache will
move to the logging phase, leaving mod_perl behind.

Right, I understand now. Too bad mod_dir doesn't run during the fixup phase or something. Seems kinda dumb to run it during the response phase.


in apache 2.0 it's a bit different. when a module registers a hook with
apache - say mod_rewrite's hook into translation - the module itself tells
apache the order. a module can choose to run first, last, or a few other
things. this is good for developers but kinda hard on administrators
because there is absoltely no ability to do the kind of thing in 2.0.

Um, I'm confused. I thought you just said you _could_ do it in 2.0.

I was
trying to give mod_perl the ability to dynamically alter its own order and
it worked for linux but not win32. one of several threads is here if you're
interested:


http://marc.theaimsgroup.com/?l=apache-modperl- dev&m=107723862520564&w=2

Doesn't seem like a major loss if you can still do it statically, so to speak. I'm not sure how to document this, though; it sounds like mod_perl 2 folks will _have_ to use my Apache::Dir module (now registered to me--thanks Doug!) if they want the mod_dir behavior, while Apache 1 users can use the ClearModules/AddModule solution if they'd rather. Or am I missing something?


ok, the way the content generation phase is dispatched is completely
different in apache 2.0. in 1.3 apache only dispatched to registered
handlers - if r->handler was perl-script then apache called mod_perl, for
instance. in 2.0 apache calls _every_ handler, and every hander has the
responsibility to check r->handler itself.

Oh, so you can more easily chain handlers? That's cool.

so, in 1.3 mod_perl registered itself for perl-script and DIR_MAGIC_TYPE,
but in 2.0 there is no registration process. currently mod_perl only checks
r->handler for 'perl-script' or 'modperl' and dispatches accordingly. I
suppose it could check for DIR_MAGIC_TYPE as well, but then to which handler
to do dispatch to, perl-script or modperl? the way mod_dir handles this is
it runs a fixup handler that sets DIR_MAGIC_TYPE if a) it's a directory, and
b) r->handler wasn't already set.


really, the number of people that actually want to handle directories
themselves is few (if any), so setting $r->handler('perl-script') from a
fixup handler isn't that big of a deal.

Well, Mason works this way. If a request comes in for /foo/ and there's a file F</foo/dhandler> and Mason is configured to handle directory requests, then /foo/dhandler will execute. It will also execute if a request comes in for /foo/bar and there is no "bar" directory. Requiring that Mason install a fixup handler will probably be somewhat of a PITA for Mason users accustomed to a simpler configuration (although I guess it's really just one more line in their httpd.conf, isn't it? Or, no! Mason can add a fixup handler itself when it loads, eh?).


well, you could have used $r->finfo to save the stat as well, but yes
DIR_MAGIC_TYPE is probably cleaner :)

Absolutely, thank you.

well, I didn't look at your code, so I was just guessing. and it was
untested :) but yes, you're right, mod_dir only engages when it's a dir
with no trailing / (plus a bunch of other subrequest foo I don't really
understand)

Right, I think all that other stuff has to do with setting up DirectoryIndex (usually "index.html") to be used for a directory request. But I'm just guessing.


yeah, I didn't realize you were using 2.0. the approaches definitely need
to be different between the two versions, but hopefully everything is a bit
clearer now. let me know if you still have questions.

No, I'm not using 2.0. I just want to make sure I can document for people how to get the same behavior from the two versions.


Thanks!

David


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to