tpgriffin
asked on
Routing to different web server based on domain path
First of all this is just a casual home office/small biz configuration (low bandwidth, few users) - really!
Configuration (2 virtual PCs):
Apache server at 192.168.1.65 (me)
ISS 2008 server at 192.168.1.55 (my son)
How can I route HTML requests to server1.domain.com to the Apache server and requests to server2.domain.com to the ISS 2008 server by either configuring one of the servers to forward to the other server or via the router. I have no problems configuring either but not both together.
Configuration (2 virtual PCs):
Apache server at 192.168.1.65 (me)
ISS 2008 server at 192.168.1.55 (my son)
How can I route HTML requests to server1.domain.com to the Apache server and requests to server2.domain.com to the ISS 2008 server by either configuring one of the servers to forward to the other server or via the router. I have no problems configuring either but not both together.
Get one server to do a redirect. I'm not sure how this works in IIS but i do know that Apache has support for virtual hosts and setting up redirects are fairly simple (just make sure you set up a virtual host for your own server first or else everything gets redirected by default)
ASKER
I"m stuck. I'll need a tested example of a Virtual Host configuration that can accomplish this with (2) domain names that already resolve to one server with one of the domain names redirected to another server on the local network.
NameVirtualHost *
<VirtualHost *>
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /var/www/
</VirtualHost>
<VirtualHost *>
ServerName www2.domain.com
Redirect permanent / http://192.168.2.5
</VirtualHost>
<VirtualHost *>
ServerName www.domain.com
ServerAlias domain.com
DocumentRoot /var/www/
</VirtualHost>
<VirtualHost *>
ServerName www2.domain.com
Redirect permanent / http://192.168.2.5
</VirtualHost>
ASKER
That almost works but http://192.168.1.55/ is used as the path and as the domain name displayed in the browser which won't work outside our network.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Apache recommends "securing" my server when using proxy with this:
<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.2
</Proxy>
Would this be inside the Virtual Host section or outside?
Thanks!
tg
<Proxy *>
Order Deny,Allow
Deny from all
Allow from 192.168.2
</Proxy>
Would this be inside the Virtual Host section or outside?
Thanks!
tg
ASKER
Also, how do I install mod_proxy on Windows Apache?
(sorry, I'm a programmer now an SA)
Thanks so much!
(sorry, I'm a programmer now an SA)
Thanks so much!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm running Server Version: Apache/2.2.8 (Win32).
That was everything I need.
It's working now.
Thanks so much!
tg
That was everything I need.
It's working now.
Thanks so much!
tg