You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Rose, John B" <jb...@utk.edu> on 2014/08/08 15:51:56 UTC

[users@httpd] Rewrite and automount question

We have experimented with using Rewrite to replace /~someuser with /someuser

However there is a problem with systems using automounter in the case of an http request for a non-existing http://someserver.com/someuser

Anyone have a way to implement the above without doing undesired automount attempts of a non-existent "someuser"?

Thanks



Re: [users@httpd] Rewrite and automount question

Posted by Nick Kew <ni...@webthing.com>.
On 8 Aug 2014, at 14:51, Rose, John B wrote:

> We have experimented with using Rewrite to replace /~someuser with /someuser

How very 1997.

> However there is a problem with systems using automounter in the case of an http request for a non-existing http://someserver.com/someuser

That's your filesystem.  Apache has no knowledge of whether a directory
exists until it performs a lookup.  And it's the lookup that triggers the automount.
Check your NFS options.

Using NFS with apache - or anywhere exposed to the public 'net -
is not encouraged.  Not good for either security or performance.

> Anyone have a way to implement the above without doing undesired automount attempts of a non-existent "someuser"?

Most simply, make sure AllowOverride is set to None.

You could also see if mod_cache helps, and if it doesn't
then you've diagnosed a major inefficiency in your server.
But mod_cache will only reduce, not eliminate, NFS accesses.

-- 
Nick Kew
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Rewrite and automount question

Posted by "Rose, John B" <jb...@utk.edu>.
"What's automounter? Is that some process that mounts a user's home directory on a remote share or something?"

Yes. But only when it is requested. I.e. When you login via ssh, or access a web site via http whose content is in the remote filesystem, etc. You may refer to it as autofs.


From: Rich Bowen <rb...@rcbowen.com>>
Reply-To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Date: Friday, August 8, 2014 3:24 PM
To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Subject: Re: [users@httpd] Re: Rewrite and automount question


On 08/08/2014 11:59 AM, Rose, John B wrote:
mod_userdir does not seem to cause superfluous automounter attempts when an http request to a non-existent web address, http://website.com/~someuser, is received

Is there some way to implement that mechanism with http://website.com/someuser http requests for a nonexistent "someuser"?

What's automounter? Is that some process that mounts a user's home directory on a remote share or something?

I suppose you could query a list of valid users on server startup, and use that (via mod_macro or something?) to generate a list of Alias directives? Or possibly use a RewriteMap to do the same thing based on a list of users, although RewriteMap can be a bit of a performance bottleneck.

--Rich



From: <Rose>, John Rose <jb...@utk.edu>>
Date: Friday, August 8, 2014 9:51 AM
To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Subject: Rewrite and automount question

We have experimented with using Rewrite to replace /~someuser with /someuser

However there is a problem with systems using automounter in the case of an http request for a non-existing http://someserver.com/someuser

Anyone have a way to implement the above without doing undesired automount attempts of a non-existent "someuser"?

Thanks




--
Rich Bowen - rbowen@rcbowen.com<ma...@rcbowen.com> - @rbowen
http://apachecon.com/ - @apachecon

Re: [users@httpd] Re: Rewrite and automount question

Posted by Rich Bowen <rb...@rcbowen.com>.
On 08/08/2014 11:59 AM, Rose, John B wrote:
> mod_userdir does not seem to cause superfluous automounter attempts 
> when an http request to a non-existent web address, 
> http://website.com/~someuser, is received
>
> Is there some way to implement that mechanism with 
> http://website.com/someuser http requests for a nonexistent "someuser"?

What's automounter? Is that some process that mounts a user's home 
directory on a remote share or something?

I suppose you could query a list of valid users on server startup, and 
use that (via mod_macro or something?) to generate a list of Alias 
directives? Or possibly use a RewriteMap to do the same thing based on a 
list of users, although RewriteMap can be a bit of a performance bottleneck.

--Rich


>
> From: <Rose>, John Rose <jbrose@utk.edu <ma...@utk.edu>>
> Date: Friday, August 8, 2014 9:51 AM
> To: "users@httpd.apache.org <ma...@httpd.apache.org>" 
> <users@httpd.apache.org <ma...@httpd.apache.org>>
> Subject: Rewrite and automount question
>
> We have experimented with using Rewrite to replace /~someuser with 
> /someuser
>
> However there is a problem with systems using automounter in the case 
> of an http request for a non-existing http://someserver.com/someuser
>
> Anyone have a way to implement the above without doing undesired 
> automount attempts of a non-existent "someuser"?
>
> Thanks
>
>

-- 
Rich Bowen - rbowen@rcbowen.com - @rbowen
http://apachecon.com/ - @apachecon


Re: [users@httpd] Rewrite and automount question

Posted by "Rainer M. Canavan" <ra...@sevenval.com>.
On Aug 8, 2014, at 17:59 , "Rose, John B" <jb...@utk.edu> wrote:

> mod_userdir does not seem to cause superfluous automounter attempts when an http request to a non-existent web address, http://website.com/~someuser, is received
> 
> Is there some way to implement that mechanism with http://website.com/someuser http requests for a nonexistent "someuser"?

mod_userdir probably checks if the user actually exists. You'll have 
to implement something equivalent with RewriteCond(s) like

RewriteCond %{DOCUMENT_ROOT}$1 -d

Adjust as needed to verify that the user (or his home directory)
actually exists. You could also run a cron job every night and check
if ~user/public_html exists and build a RewriteMap or use a script
as an external rewriting program for a RewriteMap.

rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: Rewrite and automount question

Posted by "Rose, John B" <jb...@utk.edu>.
mod_userdir does not seem to cause superfluous automounter attempts when an http request to a non-existent web address, http://website.com/~someuser, is received

Is there some way to implement that mechanism with http://website.com/someuser http requests for a nonexistent "someuser"?

From: <Rose>, John Rose <jb...@utk.edu>>
Date: Friday, August 8, 2014 9:51 AM
To: "users@httpd.apache.org<ma...@httpd.apache.org>" <us...@httpd.apache.org>>
Subject: Rewrite and automount question

We have experimented with using Rewrite to replace /~someuser with /someuser

However there is a problem with systems using automounter in the case of an http request for a non-existing http://someserver.com/someuser

Anyone have a way to implement the above without doing undesired automount attempts of a non-existent "someuser"?

Thanks