Two servers, two domains, one ip. mod_proxy beginner

Posted by Gutsav on Server Fault See other posts from Server Fault or by Gutsav
Published on 2010-01-30T00:33:01Z Indexed on 2010/05/17 11:11 UTC
Read the original article Hit count: 287

Filed under:
|
|

I run two virtual web servers (both running apache2 on debian). I have just one external IP, but two domains, and I want a domain going to each of the servers.

I've understood that I need a Reverse Proxy, and I enabled both the mod_proxy and the mod_proxy_http modules on the "primary server". Do I need to enable anything on the "secondary server"?

I also understood that I need to write some things in a virtual host file, but what? On the primary server, I have a virtual host file for one of the domains, and some for subdomains. I want domain1.tld to go to the primary server (port 80 is forwarded to it, so that works) and domain2.tld to go to the other server (internal ip 192.168.0.x). No ports needs to be forwarded to it, right? So, what to add and in which virtual host file? Or a new one? Other questions suggest adding ProxyPass and ProxyPassReverse, but I'm lost anyway, and I just don't understand the apache documentation.

Thanks in advance

© Server Fault or respective owner

Related posts about mod-proxy

Related posts about apache2