Re: Directory Restrictions
I found it, quite be accident in the Eagle Book Lost the page number, but it was in Chapter 4. There's some discussion in the last paragraph of page 86. anybody got a more specific pointer to help us fuzzy searchers find 'how to have mod_perl handle directory requests'? Hopefully this should be a pretty decent start: - package My::DirList; use strict; use Apache; use Apache::Constants qw(:common); sub handler { my $r = shift; if ($r-content_type eq 'httpd/unix-directory') { # Do whatever you need to do right here return OK; } else { return DECLINED; } } 1; -- ___ Ade Olonoh, BOTTLED SOFTWARE 317.576.1120 x12 (phone) 317.576.1135 (fax) ___
Re: Directory Restrictions
On Wed, Jun 27, 2001 at 08:52:10AM -0500, Adekunle Olonoh wrote: I found it, quite be accident in the Eagle Book Lost the page number, but it was in Chapter 4. There's some discussion in the last paragraph of page 86. anybody got a more specific pointer to help us fuzzy searchers find 'how to have mod_perl handle directory requests'? Hopefully this should be a pretty decent start: sub handler { if ($r-content_type eq 'httpd/unix-directory') { okay -- but if you want some of your site to be indexed by the standard mod_autoindex, yet have mod_perl intervene for certain subtrees, you'll find that mod_perl never gets a chance at it because the mod_autoindex gadjets catch it at an earlier stage. i think. what stage would that happen to be? and how do we configure httpd.conf to Do What We Want? (i think, that if you disable mod_autoindex, that you can have mod_perl handle directories just as you say. but there's some magic involved in running BOTH mod_autoindex and having mod_perl do a directory now and then. i think. maybe.) -- I figure: if a man's gonna gamble, may as well do it without plowing. -- Bama Dillert, Some Came Running [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Directory Restrictions
On Wed, 27 Jun 2001, will trillich wrote: okay -- but if you want some of your site to be indexed by the standard mod_autoindex, yet have mod_perl intervene for certain subtrees, you'll find that mod_perl never gets a chance at it because the mod_autoindex gadjets catch it at an earlier stage. i think. How about using RewriteRule? For example, you can do: RewriteRule /somedir/ index.pl and then when people visit http://your-site.com/somedir/, it will call index.pl. index.pl can use $ENV{REQUEST_URI} to determine which directory to display.
Re: Directory Restrictions
will trillich [EMAIL PROTECTED] said something to this effect on 06/27/2001: okay -- but if you want some of your site to be indexed by the standard mod_autoindex, yet have mod_perl intervene for certain subtrees, you'll find that mod_perl never gets a chance at it because the mod_autoindex gadjets catch it at an earlier stage. i think. what stage would that happen to be? and how do we configure httpd.conf to Do What We Want? No, mod_autoindex functions at the content generation stage (take a look at the module declaration in mod_autoindex.c). The best way to do it, I would say, is to catch directory requests in the translation phase and push your handler explicitly if the request is for a directory you want to handle. (darren) -- Whether you can hear it or not the Universe is laughing behind your back.
Re: Directory Restrictions
Philip Mak [EMAIL PROTECTED] said something to this effect on 06/27/2001: On Wed, 27 Jun 2001, will trillich wrote: okay -- but if you want some of your site to be indexed by the standard mod_autoindex, yet have mod_perl intervene for certain subtrees, you'll find that mod_perl never gets a chance at it because the mod_autoindex gadjets catch it at an earlier stage. i think. How about using RewriteRule? For example, you can do: RewriteRule /somedir/ index.pl and then when people visit http://your-site.com/somedir/, it will call index.pl. index.pl can use $ENV{REQUEST_URI} to determine which directory to display. Or just DirectoryIndex index.pl (or /index.pl) (darren) -- Now imagine a Moebius vortex inside a spherical constant, and you've got my cosmology.
Re: Directory Restrictions
On Tue, Jun 26, 2001 at 01:00:00AM -0400, Brooklyn Linux Solutions CEO wrote: I found it, quite be accident in the Eagle Book Lost the page number, but it was in Chapter 4. i know i ran across something like that at once time myself, but scanning chapter 4 for twenty minutes didn't find it. (not that i'm error-free when it comes to finding things, tho... :) anybody got a more specific pointer to help us fuzzy searchers find 'how to have mod_perl handle directory requests'? -- I figure: if a man's gonna gamble, may as well do it without plowing. -- Bama Dillert, Some Came Running [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Directory Restrictions
Brooklyn Linux Solutions CEO wrote: One thing that is not clear in my mind is the type of page which is sent back with a directory index. A directory index is of what mime type? i'm sure it's documented somewhere -- but mime types are main/secondary (text/html, image/gif) and the directory mime type is either something/directory or directory/something but you'll have to do something fancier than just look for that -- i think it's a different phase in the apache sequence where the directories are handled. i found that mod_index was intervening BEFORE i got to any apache handler (i don't recall which phase, tho)... anybody got a handy link to point us in the right direction here? how can you have mod_perl intercept the directory listing? == another thought: #httpd.conf DirectoryIndex index.md index.cgi index.html /path/to/registry/index.pl -- mailto:[EMAIL PROTECTED] http://www.dontUthink.com/
Re: Directory Restrictions
I found it, quite be accident in the Eagle Book Lost the page number, but it was in Chapter 4. ruben anybody got a handy link to point us in the right direction here? how can you have mod_perl intercept the directory listing?
Re: Directory Restrictions
On Sat, Jun 23, 2001 at 11:10:07PM -0400, Brooklyn Linux Solutions CEO wrote: I've been working on a mod_perl implimentation which does the following. ... I have something like this running on the top directory: sub handler{ my $r = shift; return DECLINED if ($r-uri() =~ /top/home.html); return DECLINED if ($r-uri() =~ /top/login.html); return DECLINED if ($r-uri() =~ /top/lower_dir1); return DECLINED if ($r-uri() =~ /top/lower_dir2); return DECLINED if (!$r-content_type('text/html)); return DECLINED if ($r-content_type('images/gif)); i bet you mistyped some of that... val =~ /pattern/flags maybe something more like: return DECLINED if ($r-uri() =~ m{/top/((home|login).html|lower_dir[12])}); It's doing an internal redirect when they are autorized for on of the lower directories, but the graphics are still now getting through to the top if I remove the DECLINED content_type 'text/html'. But when I leave it in, they seem to have access to the directory access. hmm -- ! text/html should make images/gif redundant, i'd think. anybody got a pointer, here? -- I figure: if a man's gonna gamble, may as well do it without plowing. -- Bama Dillert, Some Came Running [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Directory Restrictions
One thing that is not clear in my mind is the type of page which is sent back with a directory index. A directory index is of what mime type? Ruben On Sat, Jun 23, 2001 at 11:10:07PM -0400, Brooklyn Linux Solutions CEO wrote: I've been working on a mod_perl implimentation which does the following. ... I have something like this running on the top directory: sub handler{ my $r = shift; return DECLINED if ($r-uri() =~ /top/home.html); return DECLINED if ($r-uri() =~ /top/login.html); return DECLINED if ($r-uri() =~ /top/lower_dir1); return DECLINED if ($r-uri() =~ /top/lower_dir2); return DECLINED if (!$r-content_type('text/html)); return DECLINED if ($r-content_type('images/gif)); i bet you mistyped some of that... val =~ /pattern/flags maybe something more like: return DECLINED if ($r-uri() =~ m{/top/((home|login).html|lower_dir[12])}); It's doing an internal redirect when they are autorized for on of the lower directories, but the graphics are still now getting through to the top if I remove the DECLINED content_type 'text/html'. But when I leave it in, they seem to have access to the directory access. hmm -- ! text/html should make images/gif redundant, i'd think. anybody got a pointer, here? -- I figure: if a man's gonna gamble, may as well do it without plowing. -- Bama Dillert, Some Came Running [EMAIL PROTECTED] http://sourceforge.net/projects/newbiedoc -- we need your brain! http://www.dontUthink.com/ -- your brain needs us!
Re: Directory Restrictions
When you get a directory index, what Mime type is that? Ruben
Re: Directory Restrictions
On Sunday 24 June 2001 20:23, Brooklyn Linux Solutions CEO wrote: When you get a directory index, what Mime type is that? httpd/unix-directory Maybe it's different in windows, I don't know. -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Sex is not the answer. Sex is the question. Yes is the answer.
Re: Directory Restrictions
thanks I didn't see that in the mine.types Ruben On Sunday 24 June 2001 20:23, Brooklyn Linux Solutions CEO wrote: When you get a directory index, what Mime type is that? httpd/unix-directory Maybe it's different in windows, I don't know. -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Sex is not the answer. Sex is the question. Yes is the answer.
Directory Restrictions
Hello I've been working on a mod_perl implimentation which does the following. New users gain access to a directory, but can not get access to two directories underneath it. After logging in and receiving a cookie, they are automatically shunted to one of the two low directories. I've had some unexpected difficulty with the images of the html files. I have something like this running on the top directory: sub handler{ my $r = shift; return DECLINED if ($r-uri() =~ /top/home.html); return DECLINED if ($r-uri() =~ /top/login.html); return DECLINED if ($r-uri() =~ /top/lower_dir1); return DECLINED if ($r-uri() =~ /top/lower_dir2); return DECLINED if (!$r-content_type('text/html)); return DECLINED if ($r-content_type('images/gif)); My problem is that they can still see the directory index. I need It's doing an internal redirect when they are autorized for on of the lower directories, but the graphics are still now getting through to the top if I remove the DECLINED content_type 'text/html'. But when I leave it in, they seem to have access to the directory access. Ruben