On Tue, 05 May 2009 22:28:22 +0100 Steve <[email protected]> wrote:
> Sascha Hlusiak wrote: > > The easiest thing would probably be to just use ssh port forwarding because > > you already have all the pieces running anyway. Wouldn't a simple > > > > ssh -L 12345:secondapache:https u...@remotessh ... > I really want to avoid having to access a non-standard port from the > URLs - I want to use the final URLs exactly as they will be once the > in-development website is eventually deployed. But you don't have to! Just setup first apache to forward requests to the second one in any way you like using mod_rewrite: RewriteRule /remote/(.*) http://localhost:1235/$1 [P] The rule might need some correction, but it's here just to illustrate the point. That way you can bind any number of "remote" servers to local urls, served (in the end) by the same apache. http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html Also I think it's worth mentioning that apache isn't well suited for such a tasks if both local and remote targets get similar load - lite frontend server or reverse proxy (like nginx, lighttpd, squid, haproxy etc) should save a lot of workload. Even more, if you'll make it serve static content as well, and optimally get apache out of the equation at all ;) Another point is that apache isn't any good at mangling http headers as well, so you should make sure that remote scripts won't redirect user to 'localhost:12345' or use HTTP_HOST var from CGI interface (since it'd be set to the same localhost), using *_X_* vars instead. Alternative is, again, to install something that can mangle headers and that's any of the daemons mentioned above. -- Mike Kazantsev // fraggod.net
signature.asc
Description: PGP signature

