AcceptPathInfo usefulness (was: Re: How Do I change the Document Root Per Request)

2015-03-11 Thread Randolf Richardson
> On Wed, Mar 11, 2015 at 1:25 PM, David E. Wheeler > wrote: > > > On Mar 11, 2015, at 9:59 AM, David E. Wheeler > > wrote: > > > > > # Set the filename. > > > my $file = File::Spec->catfile($sub_root, substr $r->uri, 1); > > > $r->filename($file); > > > $r->finfo(APR::Finfo::

Re: How Do I change the Document Root Per Request

2015-03-11 Thread David E. Wheeler
On Mar 11, 2015, at 10:39 AM, Lathan Bidwell wrote: > That is very curious. What was in path_info before? Is this a difference > between undef and ""? Because path_info shouldn't be involved in finding the > file, unless Apache is configured to ignore path info. And even that doesn't > make se

Re: How Do I change the Document Root Per Request

2015-03-11 Thread Lathan Bidwell
On Wed, Mar 11, 2015 at 1:25 PM, David E. Wheeler wrote: > On Mar 11, 2015, at 9:59 AM, David E. Wheeler > wrote: > > > # Set the filename. > > my $file = File::Spec->catfile($sub_root, substr $r->uri, 1); > > $r->filename($file); > > $r->finfo(APR::Finfo::stat($file, APR::Co

Re: How Do I change the Document Root Per Request

2015-03-11 Thread David E. Wheeler
On Mar 11, 2015, at 10:15 AM, Lathan Bidwell wrote: > I am not an expert at this, so I don't have an answer. Thanks for your reply, I appreciate it. > But I can suggest a few debugging steps to clear out of the way: > > 1) Confirm that your document root is showing properly in the error log >

Re: How Do I change the Document Root Per Request

2015-03-11 Thread David E. Wheeler
On Mar 11, 2015, at 9:59 AM, David E. Wheeler wrote: > # Set the filename. > > my $file = File::Spec->catfile($sub_root, substr $r->uri, 1); > $r->filename($file); > $r->finfo(APR::Finfo::stat($file, APR::Const

Re: How Do I change the Document Root Per Request

2015-03-11 Thread Lathan Bidwell
David, I am not an expert at this, so I don't have an answer. But I can suggest a few debugging steps to clear out of the way: 1) Confirm that your document root is showing properly in the error log Does the error log report "/var/html/foo/bar.html" is not found, or does it only show the reques

Re: How Do I change the Document Root Per Request

2015-03-11 Thread David E. Wheeler
On Mar 6, 2015, at 5:29 PM, David E. Wheeler wrote: > And now it works just how I want. I take it back. It works for files in the root, but not subdirectories. So say my document root is /var/html, and a request comes in for /foo/bar.html. Apache has mapped it to /var/html/foo/bar.html, but in

Re: How Do I change the Document Root Per Request

2015-03-06 Thread David E. Wheeler
On Mar 6, 2015, at 9:21 AM, David E. Wheeler wrote: >> >> PerlMapToStorageHandler Apache2::Const::OK >> >> Otherwise it just fails super early. By adding this line, I am able to >> freely set the filename later. > > Alas, this does *not* work for directory requests, just files. Directories

Re: How Do I change the Document Root Per Request

2015-03-06 Thread David E. Wheeler
On Mar 3, 2015, at 2:27 PM, David E. Wheeler wrote: > And now I got it to work. The key was to add. > >PerlMapToStorageHandler Apache2::Const::OK > > Otherwise it just fails super early. By adding this line, I am able to freely > set the filename later. Alas, this does *not* work for dire

Re: How Do I change the Document Root Per Request

2015-03-03 Thread David E. Wheeler
On Mar 3, 2015, at 11:34 AM, David E. Wheeler wrote: > I managed to get a little further by switching from PerlFixupHandler to > PerlTypeHandler. I still get some 404s for files, but all the directories > serve properly. As it happens, I have a response handler that handles > directory request

Re: How Do I change the Document Root Per Request

2015-03-03 Thread David E. Wheeler
On Mar 2, 2015, at 9:35 PM, David E. Wheeler wrote: >PerlLoadModule My::UserFixup > >PerlFixupHandler My::UserFixup >AuthType Basic >AuthName "User File Service" >Require valid-user > I managed to get a little further by sw

Re: How Do I change the Document Root Per Request

2015-03-02 Thread David E. Wheeler
On Mar 2, 2015, at 8:27 PM, Fred Moyer wrote: > Can you show us your relevant httpd.conf snippet? No guesses right > now, but that might help. Sure. PerlLoadModule My::UserFixup PerlFixupHandler My::UserFixup AuthType Basic AuthName "User File

Re: How Do I change the Document Root Per Request

2015-03-02 Thread Fred Moyer
Can you show us your relevant httpd.conf snippet? No guesses right now, but that might help. On Sun, Mar 1, 2015 at 4:46 PM, David E. Wheeler wrote: > Hi, > > I want to set the document root for a request to map to the basic auth > username. I tried this in a PerlFixupHandler: > > sub handle