Server move

Roy Tennant rtennant at library.berkeley.edu
Wed Jul 23 17:51:45 EDT 1997


Jim,
Your message seems to have a couple things in it that I want to address 
separately. 

First, your tech support person is correct, this kind of server switch 
can be handled at the name server level. In other words, right now your 
host translates like so (for example):

Name:    CMS.CC.WAYNE.EDU
Address:  141.217.1.3

All you have to do is to change the address to which CMS.CC.WAYNE.EDU is
translated, and voila! Everyone pointing to CMS.CC.WAYNE.EDU suddenly
starts going to 141.217.1.XX instead of 141.217.1.3. Since in the move it
will also be assigned a new domain name (why, I haven't a clue; why don't
they keep the same one?) then CMS.CC.WAYNE.EDU (or whatever) can be an
alias for the new host name. For example, one of our machines has about 7
or 8 aliases (library.berkeley.edu, www.lib.berkeley.edu,
ftp.lib.berkeley.edu, etc.). Therefore you have no place to hang your "we 
have moved" sign since everyone will still be coming to the same place 
(it should be completely transparent to them).

Your second question, then, is moot for this purpose (unless someone is 
using the numeric address to point to you). But it is interesting 
nonetheless and as you will see there are other uses for this capability. 
For example, recently we took over a Web site that was at 
http.cs.berkeley.edu. The problem was that when we simply added an alias 
for http.cs.berkeley.edu to our sunsite.berkeley.edu server, folks would 
end up at the top level of that server, rather than on the entry point 
for the service that formerly lived at http.cs.berkeley.edu. So now all 
incoming requests for our top-level page that are addressing the 
http.cs.berkeley.edu host are redirected to the entry page for that 
service. I copied a fragment of code from that script just to show you 
how it works:

#!/usr/local/bin/perl
# Change the line above if your perl is elsewhere
# 

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

# Replace "AStringFromYourOldHostAddress" with what it says; ditto for
# "YourNewWebAddress", otherwise you're toast.

if ($ENV{'HTTP_HOST'} =~ /AStringFromYourOldHostAddress/) {
print "Location: http://YourNewWebAddress\n\n";
}

It is part of my welcome screen CGI, which is index.cgi in the top level 
of the sunsite.berkeley.edu server. I do several other things with that 
script as well. I used to use the REFRESH setup to shunt users off to 
this CGI program in my cgi-bin directory until I used Opera and 
discovered that all I got was a blank page (it doesn't support REFRESH). 
So be very careful about relying upon REFRESH to redirect. It doesn't 
fail very gracefully.
Roy Tennant


On Wed, 23 Jul 1997, Jim Green wrote:

> We are physically moving our web server from one building to another
> on campus.  Of course that means it's going to get a new host name and
> IP address too.
> 
> My tech support person tells me we are going to be able to alias the old
> host name to the new one so all the links to the old host name won't be
> broken.
> 
> I am using  <META HTTP-EQUIV="Refresh" CONTENT="5; URL=index2.html"> to
> display a screen explaining that the site has moved.  After a few seconds,
> it takes the user to the new URL.
> 
> My question is:  is there any way, using a cgi program or some other method,
> to take users who are already pointing their browser to the new URL
> straight to it, rather than the "site has moved" screen?  The cgi program
> would have to know which URL the browser is requesting.
> 
> I looked through my cgi books to see if there is an environment variable
> that captures this information, but I couldn't find one.  Can anyone out
> there help me figure out a way to do this?  Thanks.
> 
> ******************************************************
> *    James F. Green                                  *
> *    Systems Librarian                               *
> *    Wayne State University/DALNET Systems Office    *
> *    jfgreen at cms.cc.wayne.edu                        *
> *    tel: (313) 577-6439  fax:  (313) 577-3615       *
> ******************************************************
> 
> 


More information about the Web4lib mailing list