I have two servers running Debian with Virtualmin/Webmin and I wanted to look how can I redirect a subdomain, like a.example.com to my second server. In example:

  • I have a.example.com on the first server, IP address 192.168.1.20
  • I have a second server with IP address 192.168.1.21
  • My router is set to redirect connections to 80 port the first server IP (192.168.1.20), but when accessing a.example.com how can I do so Apache redirects it to the second server (192.168.1.21)? Thanks a lot :D
link|improve this question

feedback

1 Answer

up vote 0 down vote accepted

Maybe you should use mod_proxy for this case.

Set up one Apache at the front, and use mod_proxy to fetch the content from one of the the two servers behind.

link|improve this answer
Then I would do something like: <Location /> ProxyPass 192.168.1.21 </Location> – zad0xsis Jun 28 '11 at 9:04
EDIT: exactly, thats the way i would do it – Thomas Berger Jun 28 '11 at 9:06
Yep I know, but then I should add entries to the main server's hosts file so second server can recognize it. EDIT: thinking about it I think maybe not, but not sure as I don't have the server her right now, will mark as answer – zad0xsis Jun 28 '11 at 9:08
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.