Two domains, two servers, one dynamic IP address
- by giantman
I have two domains hi.org and bye.net and one dynamic IP address and two servers. I want to attach one domain bye.net to server1 and hi.org to server2. I'm using Apache wamp 2.0i.
I have two servers behind one router with a dynamic IP address
#httpd.conf file additions
<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</IfModule>
#vhost file additions
NameVirtualHost *:80
#default
<VirtualHost *:80>
DocumentRoot "c:/wamp/www/fallback"
</VirtualHost>
# Server 1
<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName h**p://bye.net
ServerAlias bye.net
</VirtualHost>
# Server 2
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / h**p://192.168.1.119/
DocumentRoot "g:/wamp/www"
ServerName h**p://hi.org
ServerAlias hi.org
</VirtualHost>
After doing all this I fallback to server1 only I don't get the page hi.org I only get the page bye.net, I don't even get the default fallback page which gets executed when a person enters IP address but not the domain name.
I use Windows 7 (server 2) and Windows XP (server 1)
UPDATE:
I needed to remove DocumentRoot "g:/wamp/www" line :D it was there by mistake! things are working fine now.
But one thing: the URL gets replaced by the local ip address any way to not make that happen?