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 da...@justatheory.com 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

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

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 da...@justatheory.com wrote: On Mar 11, 2015, at 9:59 AM, David E. Wheeler da...@justatheory.com wrote: # Set the filename. my $file = File::Spec-catfile($sub_root, substr $r-uri, 1); $r-filename($file);

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 lat...@andrews.edu 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

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 da...@justatheory.com wrote: On Mar 11, 2015, at 9:59 AM, David E. Wheeler da...@justatheory.com wrote: # Set the filename. my $file = File::Spec-catfile($sub_root, substr $r-uri, 1); $r-filename($file);

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 lat...@andrews.edu 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

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 da...@justatheory.com wrote: # Set the filename. my $file = File::Spec-catfile($sub_root, substr $r-uri, 1); $r-filename($file);

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 da...@justatheory.com 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.

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 da...@justatheory.com 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

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 da...@justatheory.com wrote: PerlLoadModule My::UserFixup Location / PerlFixupHandler My::UserFixup AuthType Basic AuthName User File Service Require valid-user /Location I

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 da...@justatheory.com 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

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 f...@redhotpenguin.com wrote: Can you show us your relevant httpd.conf snippet? No guesses right now, but that might help. Sure. PerlLoadModule My::UserFixup Location / PerlFixupHandler My::UserFixup AuthType Basic

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 da...@justatheory.com 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:

How Do I change the Document Root Per Request

2015-03-01 Thread David E. Wheeler
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 handler { my $r = shift; # We only want to do this once per request. return DECLINED unless $r-is_initial_req; # Get the username.