Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple machines using one address 2

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
I was wondering if there was a way to setup apache so that it forwarded requests for a certain directory to another machine. The problem I am trying to solve is this: I have two linux boxes behind a gateway that ip-masquerades them at home. one pc serves my personal website and email, the other is for personal uses like surfing the web and experimenting with. I would like to access the second using webmin with ssl, and be able to access the first using ssl also (so that I can check my email). This would be easy to solve using port forwarding; however, my company blocks all connections that are not on 80 or 443, so both machines have to share 443. Assuming my web server is at I would like to be able to access webmin on the second machine by say typing in: and access my email on the first machine by typing .To do this I would need all initial requests to be forwarded to the first machine, and then if the request is for the directory /webmin/ they would then be masqueraded/forwarded to the second machine. Is there a way to do this?? What about using a different domain name instead .... so rather than it would be . Is there a way to setup a linux box as a gateway that forwards based on domain name as opposed to ip address? What about apache, can that be setup to do this?

-Venkman
 
In this case you could use the reverse proxy function of mod_proxy. On the first server I beleive the directives would be something like the following:
Code:
<Location /webmin>
  ProxyPass [URL unfurl="true"]https://second-server.myserver.com/webmin[/URL]
  ProxyPassReverse [URL unfurl="true"]https://second-server.myserver.com/webmin[/URL]
  ...
</Location>
This might need to be tweaked a little. It's been a while since I've used mod_proxy and I don't remeber the exact syntax.
 
I got it to work proxypass and proxypassreverse. The only problem is that webmin references things by absolute path, which means that when it tries to call /blah.script it calls it on the original server rather than at the proxied server (which would have the path of /webmin/blah.script). To solve this problem I changed the dns entries and virtual hosts around. Now, if you access you get the main website, but if you access mypc.mywebsite.com you get webmin runing on the other machine.

Thanks again for your help.

-Venkman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top