I'm running HTTPD on a CentOs 6 server.
I have 2 servers on the same LAN as eachother. I only have 1 IP address. I have 2 domains pointing at the router and I want example1.com handled by server 1 and example2.com handled by server 2. The router can forwards PORT 80 to server 1. I need server 1 to forward traffic directed at example2.com to server 2.
It needs to not interfere with other virtual host targets that look like this:
<VirtualHost *:80> DocumentRoot /var/www/html/example1.com ServerName example1.com </VirtualHost>
I tried it using mod_rewrite like this:
<VirtualHost *:80> ServerName example2.com RewriteEngine On RewriteRule .* http://192.168.1.60$0 [P] </VirtualHost>
but when I load up example2.com in the browser, it tries to load 192.168.1.60, which I can't see because the browser is not on the same LAN as the 2 servers.
How do I do this?