Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache alias server name redirect

Status
Not open for further replies.

TheDash

MIS
Mar 25, 2004
171
US
Hi members,
I need to set up an alias on Apache HTTP Server so that when someone accesses they will automatically get redirected to We are trying to take server1 off completely and we would like to redirect users who still use the old link. We cannot use redirect. We simply want to use alias because the old server server1 will be offline completely.

Currently both server1 and server2 IP addresses are same. I also checked that a tracert on server1 is reaching server2. How can this be accomplished? Should I set up virtual hosts or alias on ssl.conf file? Any help will be appreciated. Thanks in advance.
 
Things may be working, at least partially, due to the difference in MAC addresses, but having the same IP address going to both servers is only going to cause you troubles and you should fix this.

Once you have both servers up and running, you can do several things. One, you can have the new server2, assigned to the IP address of the original server1. If this is a public IP address then all the web traffic will go to server2 and server 1 is out of the loop. Two, you have use a rewrite rule or a proxy setting in Apache to re-direct all traffic to server2 at its IP address.
 
Only 2 things are needed to accomplish what you want.

In Apache's httpd.conf create the ServerAlias for server1.domain.com [in the VirtualHost for server2 if applicable]

Change the DNS A or Cname for server1 to point to the IP (or name) of server2.

The only other thing to consider is the actual page names. If someone has a bookmark or link to does exist? If not, you might also need some rewriting rules or other error handling logic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top