Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

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.

share|improve this answer
    
Then I would do something like: <Location /> ProxyPass 192.168.1.21 </Location> –  pmerino 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 –  pmerino Jun 28 '11 at 9:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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