David Wheeler wrote: > Thanks for the great reply, Geoff. Sorry I didn't get back to you > sooner. I've ben snorkeling for the last week. :-)
no problem :) > 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. no, you can't do it in 2.0. at least not yet. well, I mean you _can_ but it requires altering mod_perl source code between the autogeneration (perl Makefile.PL) and make. or altering mod_dir. > >> 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. yeah. at first I thought about a compile time option. then stas thought we could use macros to pick up on -D switches. then I figured out how to have it directive-oriented, which we all preferred. then we tested the solution on win32 and *boom* > 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? I'll need to look into it more, but I think that's backwards. mp1 registers itself for DIR_MAGIC_TYPE, which means it will be invoked when mod_dir ordinarily would. mp2 does not handle DIR_MAGIC_TYPE so it will pass on those requests and mod_dir will take over. I guess this means that while for mp2 mod_dir will work just fine, folks like Mason will _not_ be able to rely on their PerlResponseHandler being invoked for directories. > >> 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. no, not really. the first OK still ends the chain, so it's not really about stacking handlers at all. really, I don't know the rationale behind it, and it seems incredibly less efficient than the way things used to be in apache 1.3. for chaining handlers you would want to use output filters, which are uber cool. >> 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?). yeah, Mason will be able to use $s->add_config from module load to add a PerlFixupHandler, which should essentially satisfy the requirements right there. or even as a PerlTypeHandler, especially now that mod_mime no longer has its strangle hold on that phase. > 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. I think that the way to get mp2 to behave like mp1 wrt directories is to use the fixup phase to: $r->handler('perl-script') # or $r->handler('modperl') if $r->content_type == DIR_MAGIC_TYPE && $r->uri !~ m{/$}; as for Apache::Dir, I guess it becomes a mp1-only solution. at least that's what I think I see after this rather long digression :) you might want to benchmark the difference between Apache::Dir as you have it and simply using a fixup handler to clear the PerlHandler stack under the proper conditions then letting mod_dir handle the directory after all. of maybe I'm just more confused now... HTH --Geoff --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]