Change main i-mspcp IP address.

  • Hello,


    i guess this kind of a short howto is missing for i-mscp. So I decided to write a short howto on the forum.
    Mostly for people who don't know what ispcp was and are looking for a solution in i-mscp ;)


    First change IP address in /etc/imscp/imscp.conf


    find:
    BASE_SERVER_IP


    and replace the old IP address with a new one:

    Code
    1. BASE_SERVER_IP = [new_IP]


    then, stop the i-mspcp daemon:

    Code
    1. /etc/init.d/imscp_daemon stop


    Now we need to change the IP address in database.
    Also we need to change the domain status from 'ok' to 'changed' so that the IP address will be replaced by a new one for all
    domains, subdomains and aliases.


    Login to mysql and switch to i-mpscp database(you can also do it via phpMyAdmin):

    Code
    1. mysql -u root -pUSE imspcp;


    now change the IP addres and the domain status:


    SQL
    1. UPDATE server_ips SET ip_number = "new_ip" WHERE ip_id = 1;UPDATE `domain` SET `domain_status` = 'change' WHERE `domain_status` = 'ok';UPDATE `subdomain` SET `subdomain_status` = 'change' WHERE `subdomain_status` = 'ok';UPDATE `domain_aliasses` SET `alias_status` = 'change' WHERE `alias_status` = 'ok';UPDATE mail_users SET status="toadd" where status="ok";



    Now we need to update the domains config and status, run:

    Code
    1. /var/www/imscp/engine/imscp-rqst-mngr


    We can start i-mspcp daemon:

    Code
    1. /etc/init.d/imscp_daemon start


    Last thing we need to do is to modify the IP address in Apache and Bind configuration files, basically we need to replace the old IP address with a new one.
    This can be done with the simple sed onliner bellow (just replace the word oldIP with old IP address and newIP with the new IP address):

    Code
    1. sed -i "s/oldIP/newIP/g" /etc/apache2/sites-available/* /etc/bind/* /var/cache/bind/* /etc/imscp/*/working/*



    Restart apache and bind:

    Code
    1. /etc/init.d/apache2 restart
    2. /etc/init.d/bind9 restart


    And that's it.

    Edited once, last by aseques ().

  • Hello;


    With the last RC (1.1.0-rc1.4), you only have to do:


    Code
    1. # cd /var/www/imscp/engine/setup# perl imscp-setup --reconfigure


    With the next release, you will only have to do


    Code
    1. # cd /var/www/imscp/engine/setup
    2. # perl imscp-setup --reconfigure ips

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • I think, the first topic is reasonable for life as an "expert mode", please post it to our wiki, using your forum account.

  • thanks, good guide. this and the changing of IP for NAT setups is very helpful for some people.


    Quote

    With the next release, you will only have to do


    Code:
    # cd /var/www/imscp/engine/setup
    # perl imscp-setup --reconfigure ips


    that's awesome, nux :)

  • I just updated the post to reflect the proper names for current versions of imscp.


  • I created a new page in the wiki to have these instructions documented, can be found at http://wiki.i-mscp.net/doku.php?id=start:howto:changeip


    Hello


    The 1.1.0-rc3 is already release.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206