Discussion:
Handling a server whose IP name is going to change
(too old to reply)
Swifty
2012-07-04 14:08:39 UTC
Permalink
I've been informed that one of my hosts will have its IP name changed
on the 31st July. I already have the new IP name, which resolves to
the same IP address, so it's easy to put in a redirect now.

I'd like to redirect to a temporary page on the server's NEW IP name,
and there run a CGI script informing the user of what is happening,
and actions that they must take (update bookmarks, get page with
doomed URL fixed, etc).

Handling the redirect to the CGI script is simple, but arranging for
the script to have access to the original URI is a little trickier.

I could use a RedirectMatch directive, and capture the original URI in
a regex variable, then construct the target URL so it redirects to
something like:

http:new.server/cgi-bin/new_ip_name.cgi?original_uri

I think (without actually trying it) that my redirectmatch should be
something like this (in old.server virtualhost definition):

RedirectMatch (.*) http://new.server/cgi-bin/new_ip_name.cgi?$1

This seems a workable solution. Is there anything obviously easier?
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Evan Platt
2012-07-04 15:41:12 UTC
Permalink
Post by Swifty
I've been informed that one of my hosts will have its IP name changed
on the 31st July. I already have the new IP name, which resolves to
the same IP address, so it's easy to put in a redirect now.
What is an IP name?
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Swifty
2012-07-04 15:55:01 UTC
Permalink
On Wed, 04 Jul 2012 08:41:12 -0700, Evan Platt
Post by Evan Platt
What is an IP name?
Something like theobvious.espphotography.com.invalid or www.google.com
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Evan Platt
2012-07-05 13:34:55 UTC
Permalink
Post by Swifty
On Wed, 04 Jul 2012 08:41:12 -0700, Evan Platt
Post by Evan Platt
What is an IP name?
Something like theobvious.espphotography.com.invalid or www.google.com
That's a domain name. There's no such thing as an "IP NAME".
--
To reply via e-mail, remove The Obvious and .invalid from my e-mail address.
Lewis
2012-07-04 23:04:47 UTC
Permalink
Post by Swifty
I've been informed that one of my hosts will have its IP name changed
This makes no sense. Is the IP address changing, or the name?

There is no such thin as an 'IP name'.
Post by Swifty
on the 31st July. I already have the new IP name, which resolves to
the same IP address, so it's easy to put in a redirect now.
Erm. So a new Domain name and the same IP address?
--
Silence is golden, duct tape is silver.
Swifty
2012-07-05 06:22:05 UTC
Permalink
On Wed, 4 Jul 2012 23:04:47 +0000 (UTC), Lewis
Post by Lewis
Erm. So a new Domain name and the same IP address?
Well, lest we degenerate into tautology, the "server-name" part of
http://server-name/index.html is being deleted from our organisations
DNS on July 31. :-)

The apache server hosts a number of virtualhosts, whose "server-name"
will not be affected. Nor will its IP address change.

But there is a significant proportion of our user base who use the
original (and soon extinct) "server-name". So they will get "Not
found" or however their browser responds to invalid names.

So, I'm going to try to intercept accesses to "server-name" with a
page on one of the VirtualHosts which:

1. Tells the user that "server-name" is going away, and they have till
Jul 31 to do something about it.

2. Suggest that they update their bookmarks, or contact the owner of
webpages with links to "server-name"

3. Offers them an onward link to the new location of the page (which
differs only in the "server-name" part)

In the past, I would have had this done in a few minutes, but because
of a degenerative memory problem, such tasks are no longer as simple
as they were for me.

I'm fairly certain that a:

RedirectMatch (.*) http://new-server-name/cgi-bin/name-change?$1

... will redirect them to the CGI script "name-change" on
"new-server-name" with the originally request URI available in the
QUERY_STRING. This CGI will implement the list of actions above.
Despite memory problems, I can construct such a CGI script in a trice.

But something is nagging at me that there might be an easier, or
perhaps more elegant way of handling this. This is the insidious
nature of memory problems; you never know what you have forgotten...

Perhaps I can put this more succinctly: We have a server where the
default virtual host and the primary production virtual host are the
same. But the name of the default virtualhost is being removed from
our DNS. How to smooth things over for the users?
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Lewis
2012-07-05 08:02:48 UTC
Permalink
Post by Swifty
On Wed, 4 Jul 2012 23:04:47 +0000 (UTC), Lewis
Post by Lewis
Erm. So a new Domain name and the same IP address?
Well, lest we degenerate into tautology, the "server-name" part of
http://server-name/index.html is being deleted from our organisations
DNS on July 31. :-)
Host name, DNS, or, I suppose, Server Name. But IP Name made no sense
because an IP is a number. Knowing nothing about you or your situation
it was impossible to figure out exactly what you meant.
Post by Swifty
RedirectMatch (.*) http://new-server-name/cgi-bin/name-change?$1
... will redirect them to the CGI script "name-change" on
"new-server-name" with the originally request URI available in the
QUERY_STRING. This CGI will implement the list of actions above.
Despite memory problems, I can construct such a CGI script in a trice.
Yes, that's basically it, though I don't think a cgi is necessary. You
are already passing the original URL in the link, so simply have some
PHP on the redirect page parse it to create the link to the
new-server-name:

RedirectMatch (.*) http://new-server-name/old-server.php?$1
Post by Swifty
Perhaps I can put this more succinctly: We have a server where the
default virtual host and the primary production virtual host are the
same. But the name of the default virtualhost is being removed from
our DNS. How to smooth things over for the users?
No matter what you do, if the users are used to using the default VHost,
it is going to end badly. You may have people who have hundreds of links
they need to update. How long does the old server-name stick around? Why
can't it simply be made a Virtualhost ServerAlias? Hopefully you are in
a position where you can say, "This is how it is, deal with it."
--
If there's a bustle in your hedgerow don't be alarmed now.
Swifty
2012-07-05 08:19:10 UTC
Permalink
On Thu, 5 Jul 2012 08:02:48 +0000 (UTC), Lewis
Post by Lewis
How long does the old server-name stick around?
That's the easy one. The service providing the corporate-wide Dynamic
DNS is being turned off on July 31st.

So, as you say: "This is how it is, deal with it."
--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk
Continue reading on narkive:
Loading...