[ale] How to proxy a web app via Apache & SSH?

Jason Day jasonday at worldnet.att.net
Tue Jan 25 10:18:51 EST 2005


On Sat, Jan 22, 2005 at 05:17:13PM -0500, Benjamin Scherrey wrote:
>    So... my idea is that I would like to be able to use ssh port 
> forwarding to make it appear that my application is running on the 
> internet server. My user should be able to go to www.myserver.com/myapp 
> and have my apache webserver redirect this request via ssh to my inhouse 
> machine. This will give me a secure connection to my internal host 
> without having to setup SSL or give away my internal static IP address 
> to users. Does Apache have this capability? Is my idea a valid one or 
> more of a PITA than its worth?

Ben,

You might be able to do this using Apache's mod_proxy to setup a reverse
proxy on your web server.  I've never tried this, but if you setup an
ssh tunnel like:

  ssh -L 8000:your.ip.com:80 your.ip.com

Then setup mod_proxy to forward requests to localhost:8000.  You also
might be able to use mod_rewrite, that might be easier to setup.

Here's an article on reverse proxies:
http://www.apacheweek.com/features/reverseproxies

Also, man ssh_config and checkout the ServerAliveInterval and
ServerAliveCountMax options, to keep your ssh tunnel from timing out.

HTH,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9



More information about the Ale mailing list