Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    5

    Default Change all sites ips on a server

    Hi,

    I'm looking for a simple script (using awk?) that will change the ip address of all sites on my servers in httpd.conf. Basically all of my ips have changed and I need to update the ip address of approx 1200 sites on about 5 different servers. It will take MUCH too long to do them by hand. Any suggestions would be appreciated. I know cpanel has the "change sites ip" feature, but it has to be done site by site.

    Thanks

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:

  2. #2
    Member
    Join Date
    Mar 2003
    Posts
    5

    Default

    Any way to globally change each sites ip using the "changesiteip" script in /scripts ??

    All accounts are on shared ips...

    cPanel.net Support Ticket Number:

  3. #3
    Member
    Join Date
    Nov 2001
    Location
    New Jersey
    Posts
    80
    cPanel/Enkompass Access Level

    DataCenter Provider

    Default

    Are you wanting to change the IP number(s) to other IP numbers currently on the same box? Or are you wanting to change the IP numbers to completely different IP's as if you were going to move the server to a different colocation facility? The prior is easier, the later is harder because you have to do them all at one time, instead of gradually at your leisure.

    Also, please consider any customers who do their own web development who might have utilized IP numbers in their page source code or scripts. But then again you said they're all on shared IP's so nobody should be using hard coded IP numbers.

    OK, I have been no help, but just adding food for thought.

    Drake P.

    www.DuraServer.net
    Web Hosting ~
    Shared & Dedicated Servers ~
    Networking ~ Linux
    Last edited by Drake; 06-25-2003 at 12:48 PM.

  4. #4
    Member
    Join Date
    Aug 2002
    Posts
    1,052

    Default

    I would assume that you're going to leave the last few octets the same. If this is the case, you only have to modify a few files by hand. Say that your existing box is under 10.1.1.0/24 and you need to change everything to 10.2.1.0/24, simply open each config file up in vi and issue the following:

    :%s,10.1.1,10.2.1,g
    :wq

    Be sure to make a backup of each config before you do this. You should only have to modify httpd.conf, proftpd.conf, domainips.

    To do your cpanel users file and your zone files, you will need to use the following:

    cd /var/cpanel/users/
    replace 10.1.1 10.2.1 -- *

    cd /var/named/
    replace 10.1.1 10.2.1 -- *

    Once you've completed all of the above, you will need to edit your ipaliases file as well as your ifconfig stuff.

    edit your ips file with vi and use the :%s command from above. For your main IP you can either use the setup command or edit the files manually in the network conf files.

    Once you're all done the changes, a reboot will bring everything back up on the new IPs.

    Just a warning, if you're not sure what I've instructed you to do above. I would suggest you read up on the commands before issuing them.

    cPanel.net Support Ticket Number:
    Last edited by ciphervendor; 06-25-2003 at 01:07 PM.

Similar Threads & Tags
Similar threads

  1. Many sites on different IPs...
    By LiNUxG0d in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 04-02-2009, 12:03 PM
  2. 2 shared ips, multiple sites
    By apogee in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 05-25-2006, 10:17 PM
  3. Maximum Number Of IPs / Sites
    By zfasteddie in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-17-2005, 06:43 PM
  4. How do I change server ips and change dns zone refresh intervals
    By deu12000 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-04-2004, 09:48 PM
  5. Change of all IPs on the server
    By pguy in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-14-2003, 02:24 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube