Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    1

    Default Seamless way to change IP on website

    I have a dedicated server with 5 ips. I want to change the ip for one of my sites to a different ip. I am told pretty much the site has to be down for a few hours while it propagates.My host tell me there is nothing I can do, but let it be down. Is there a Seamless way to change this?
    Last edited by control1110; 11-20-2009 at 01:26 AM.

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Apr 2008
    Location
    PK
    Posts
    443

    Default

    Quote Originally Posted by control1110 View Post
    I have a dedicated server with 5 ips. I want to change the ip for one of my sites to a different ip. I am told pretty much the site has to be down for a few hours while it propagates.My host tell me there is nothing I can do, but let it be down. Is there a Seamless way to change this?
    You can change TTL in the DNS zone of the site to a much lower value and change the site's IP after the current value of TTL before editing. Say your current value of TTL is 86400, you can lower this value and change site's IP after 24 hours (86400 seconds).
    1 solution works for all problems. Trying harder!
    HostMasterTips - Understanding Tech Support

  3. #3
    Member
    Join Date
    Apr 2009
    Posts
    230

    Default

    Nowadays, DNS propagation does not take long hours. If you do it in the off-peak hours then you should be all good.

  4. #4
    Member
    Join Date
    Nov 2007
    Posts
    110

    Default

    Quote Originally Posted by InstaCarma_Tech View Post
    Nowadays, DNS propagation does not take long hours. If you do it in the off-peak hours then you should be all good.
    OP, don't take this persons advice and blindly do it at "off-hours". The propagation can take as long as the TTL is set for.

    Listen to the other person. Check the TTL values on the zone and hostnames, note what they are. Propagation can take up to that many seconds. If you're okay with it, then do it.

    If not set the TTL low (like 300 = five minutes) and then after updating zone wait at least (old TTL seconds) before changing the IP. Once you have done the change you can up the TTL.

    If you have the TTL set to 86400 and listen to the advice of "do it off-peak" you really will have some people not getting the site up to 24-hours later, with an average prop time of 12-hours.

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2003
    Location
    NC
    Posts
    725
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    If you don't mind getting your hands dirty and are familiar with apache take a copy of the domains vhost and put it in one of the configs that cpanel has that do not get updated. Then change the ip. Now you will have 2 vhosts, one for the old IP and one for the new. No matter what IP they hit they still get the site.

    If you don't do it this way lowering the TTL a few days before and then doing it late at night is your best bet.

  6. #6
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    231

    Default

    eth00 is right, this is the best way to do (having 2 vhosts until new IP propagate). This should be a feature for next cPanel versions.

  7. #7
    Member
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    1,050

    Default

    Quote Originally Posted by InstaCarma_Tech View Post
    Nowadays, DNS propagation does not take long hours. If you do it in the off-peak hours then you should be all good.
    What "eth00" said is possible but what "InstaCarma_Tech" said is not false either. Nowadays, propagation does take a 2-3 hours and if you change the website IP during off hours, you should be fine.

  8. #8
    d_t
    d_t is offline
    Member
    Join Date
    Sep 2003
    Location
    Bucharest
    Posts
    231

    Default

    @madaboutlinux, do you think few years ago DNS propagation took more? It's all about TTL but some ISP DNS servers ignore the value from the zone and keep the old info in cache. More, if you check the logs after you move a website, you can see that some spiders (like yahoo) keep visiting the old IP for days.

    Why should you have a website down for 2-3 hours when you can keep it alive on the old IP (whenever is possible).

  9. #9
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2003
    Location
    NC
    Posts
    725
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by d_t View Post
    Why should you have a website down for 2-3 hours when you can keep it alive on the old IP (whenever is possible).
    Exactly! It only takes a few minutes to setup the other vhost, really 1-2 if you know what you are doing. That 1-2 minutes will save you a lot of possible headaches, why not just do it?

  10. #10
    Member
    Join Date
    Nov 2007
    Posts
    46

    Default

    I have a similar need to migrate an important account to a new IP.

    Having an apache vhost entry for both IPs sounds like a good solution.

    Would this work with SSL?

  11. #11
    Member
    Join Date
    Nov 2007
    Posts
    46

    Default

    So, I've been doing some experimenting with the duplicate vhosts on a test domain.

    I've been using the following doc for guidance:

    cPanel - The Easy Apache Configuration System - Adding Custom Directives to httpd.conf

    My first mistake was to take the httpd.conf comments too literally:

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/test/test.abc123.co.uk/*.conf"

    I created an include file in the specified location which consisted of a copy and paste of the standard (non SSL) vhost section in httpd.conf. I then ran:

    /scripts/verify_vhost_includes

    Which returned:

    Testing /usr/local/apache/conf/userdata/std/2/test/test.abc123.co.uk/std.conf...ok

    then I ran:

    /scripts/ensure_vhost_includes --user=test

    Which returned:

    Syntax error on line 1 of /usr/local/apache/conf/userdata/std/2/test/test.abc123.co.uk/std.conf:
    <VirtualHost> cannot occur within <VirtualHost> section

    So I now see that using this kind of include won't work for creating duplicate vhosts as it applies literally to the directives *within* the <VirtualHost> tags.

    I'm now thinking I need to use another included method...
    Last edited by keddie; 11-30-2009 at 05:24 PM.

  12. #12
    Member
    Join Date
    Nov 2007
    Posts
    46

    Thumbs up

    The solution is extremely simple and it works with SSL

    Here's what I did:

    1) Edit /usr/local/apache/conf/httpd.conf and copy the current vhost entries that you want to duplicate.
    2) In WHM, go to: Main >> Service Configuration >> Apache Setup >> Include Editor.
    3) Scroll down to "Post VirtualHost Include" and select "All versions" from the dropdown.
    4) Paste the vhost directives in to the box and then update the IP addresses to the new ones.
    5) Click "Update" then "Restart Apache"

    I used my local hosts file to test the new aliased IPs and they worked great.

    Thanks for the pointers OPs

    Al

  13. #13
    Member paulkoan's Avatar
    Join Date
    Nov 2006
    Posts
    80

    Default

    The term "propagate" suggests to many that something actually is moving across the internet and is no doubt the source of the earlier poster's confusion in thinking that this movement will somehow go quicker at "night" when things are less busy.

    It is a convenient word to use for those who understand what it is actually saying but we could do with something else for those who don't.

    To anyone happening across this thread, it works like this: You request the IP for a server from your local DNS server. The DNS server will go and ask the authoritative DNS server for that domain, who will respond with the IP address, plus a TTL value which lets the local DNS server know how long that response is good for. Lets say it gives a TTL of a week. This means that for subsequent requests for this same server, the local DNS server will not bother asking the authoritave DNS as it already knows the answer - until the week expires.

    So if you change your IP address during this week, then this change will not 'propagate' to this local DNS server until a week has passed since the last time it asked, whereupon it will go back to the authoritative DNS server and get the new IP.

    As DNS servers all over the planet will be asking the question at different times, some will update immediately, some will take a full week.
    ServWise Advanced Hosting - Better, Faster, Smarter

Similar Threads & Tags
Similar threads

  1. Seamless way to change IP on website ??
    By wosiho99 in forum New User Questions
    Replies: 5
    Last Post: 10-28-2009, 09:12 PM
  2. Change website Source Harddrive
    By dlewis23 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-11-2007, 11:32 PM
  3. Is 'seamless' copying of hosting accounts possible, including email?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-22-2006, 09:12 AM
  4. Seamless Server Migration?
    By Daemonia in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 10-15-2005, 10:58 AM
  5. CHANGE: There is no website configured at this address.
    By 2fangs in forum New User Questions
    Replies: 3
    Last Post: 11-25-2004, 11:39 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube