httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Martens <jmart...@cityofevanston.org>
Subject Re: [users@httpd] redirect
Date Wed, 07 Dec 2005 21:36:13 GMT
On Wed, 2005-12-07 at 12:37 -0500, mwlist wrote:
> I'm setting up a system and need some advice the situation is described below.
> 
> Currently
> Machine 1 is a linux box with apache 2 serving our main site www.site.com
> Machine 2 has our users personal web site data which users upload with
> shell access.
> Machine 1 nfs mounts machine 2 and serves the user pages at www.site.com/~user
> 
> I would like to get rid of the NFS mount.
> 
> So can I have apache 2 forward requests for www.site.com/~user to
> machine 2 and still retain the same url? I was thinking of using
> mod_alias to do this.
> Redirect /~*    http://machine2.com/~*
> Any ideas?

Mod_alias only uses paths on the local server, so that's not what you
are looking for. You probably want to use mod_proxy or mod_rewrite with
the [P] option for proxying.  ModRewrite would probably require the
least amount of apache configuration, once you get the right regular
expression that is.  

Something like "ProxyPass /~user http://machine2.com/~user" might work,
but to avoid putting a line like that in your apache config for each
user, you probably want to use a RewriteRule something like this:

RewriteRule   /~(.*) 	http://machine2.com/~$1		[P]
Note, I'm not terribly good with mod_rewrite, but this should get you
started.

You could also use the Redirect directive, but that would point your
clients to the other server so www.site.com/~user would become
http://machine2.com/~user in your client's url, and I don't think that's
what you want.

Jason Martens

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message