0

I have a production site, running off 10 servers. I've been given another virtual server on the same network as these 10 servers, to use for testing purposes. This server doesn't have it's own DNS entry. Therefore I need to do a redirect to the site hosted on this virtual server for a sub-domain of the site running on the 10 other servers.

So Basically I was wondering how I would configure a sub domain of my production server to point at the Virtual server for testing.

I'm guessing I need to modify my site file in

/etc/apache2/sites-available

and add another virtual host like the following and modify the redirect match:

<VirtualHost *>
        ServerName SUBDOMAIN.DOMAIN.com
        RedirectMatch 301 (.*) **IP ADDRESS**
        CustomLog /var/log/apache2/SUBDOMAIN.DOMAIN.com.access.log combined
</VirtualHost>

Do I set the redirect match to just the IP on the Virtual server, and then configure another site file in the sites-available directory, which will recption this redirect and point the browser towards the HTML root?

Thanks, I hope I made myself clear.

2
  • Do you want simply to redirect to the test server or do you want the address to stay in the address bar? You could take a look at mod_proxy: httpd.apache.org/docs/2.2/mod/mod_proxy.html Feb 17, 2011 at 13:02
  • preferably to have the address stay in the address bar. basically have it act as a sub-domain, and when you go to that URL and visit pages it'll stay with the subdomain in the URl as one browses the site. Will have a look at that link. Thank you Feb 17, 2011 at 14:24

1 Answer 1

0

zeroFIG@ when you do a 301 redirection the address in the address bar will change. If you want to keep the address the same you can look at apache mod_proxy as pointed out by fbh@.

Secondly if its an internal server, with an internal IP your clients will get an error. i.e if example.com redirected to 192.168.1.100/index.html then I will get a error if I am access the site over the internet.

1
  • I see I see, so if there isn't a public IP for that virtual server, there is no way to access it from outside of the VLAN where the servers lie. If there is, I'd not want to do a 301, otherwise they would have the IP of the server in their address bar. SO what redirect code would I use? Feb 17, 2011 at 15:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .