ispmanager 6

/
/
Panel unavailable after changing server IP address

Panel unavailable after changing server IP address

Symptoms

After changing a server IP address, the panel is not accessible either at the new or the old IP address.

Causes

The panel's web server is configured to listen on an old IP address that is no longer present on the server.

Solution

If the server IP address was changed without prior preparation of the panel, you will have to make changes manually.

Correcting the IP address of the panel web server

  1. Get the old IP address for the panel's built-in web server with the following command:
    grep ip /usr/local/mgr5/etc/ihttpd.conf | grep "^[^#*]"
  2. Replace the old IP address with the new one by running the command:
    sed -i "s/PREV_IP_ADDRESS/CURR_IP_ADDRESS/g" /usr/local/mgr5/etc/ihttpd.conf
  3. Restart the built-in web server: 
    systemctl restart ihttpd

Make sure that the web server service has started successfully. If the output of the command below is «Active: active (running)», the web server service has started successfully:

After this, the web interface of the panel will become available.

Correcting Nginx virtual host IP addresses

  1. Replace the previous IP address with the current one for all Nginx hosts by running the following command:
    sed -i "s/PREV_IP_ADDRESS/CURR_IP_ADDRESS/g" /etc/nginx/vhosts/*/*
  2. Check other Nginx configuration files for the old IP address:
    grep -r PREV_IP_ADDRESS /etc/nginx | grep "^[^#*]"
  3. Replace the old IP address with the new one in all the configuration files that were obtained in the output of the previous step:
    sed -i "s/PREV_IP_ADDRESS/CURR_IP_ADDRESS/g" <path-to-file>
  4. Restart the Nginx web server:
    systemctl restart nginx

Make sure that the web server service has started successfully. If the output of the command below is «Active: active (running)», the web server service has started successfully:

Correcting Apache virtual host IP addresses

  1. Replace the previous IP address with the current one for all Apache hosts by running the following command:
    sed -i "s/PREV_IP_ADDRESS/CURR_IP_ADDRESS/g" /etc/apache2/vhosts/*/*
  2. Check other Apache configuration files for the old IP address:
    grep -r PREV_IP_ADDRESS /etc/apache2 | grep "^[^#*]"
  3. Replace the old IP address with the new one in all the configuration files that were obtained in the output of the previous step:
    sed -i "s/PREV_IP_ADDRESS/CURR_IP_ADDRESS/g" <path-to-file>
  4. Restart the Apache web server:
    systemctl restart apache2

Make sure that the web server service has started successfully. If the output of the command below is «Active: active (running)», the web server service has started successfully:

Please note!

In RHEL-based operating systems, the Apache web server directory and service are called «httpd».

Correcting the IP address in other files

If the mail server is installed, replace the IP address in the Exim configuration file:

For RedHat-based operating systems, the path to the Exim configuration file is different  /etc/exim/exim.conf.

If the native database server previously used the old IP address for operation (not localhost127.0.0.1 or 0.0.0.0), replace the IP address in its configuration files.

You will also need to recreate the alternative DBMS created by the panel tools, the databases will be saved.

Please note!

Before recreating alternative DBMS, it is recommended to make backup copies, which are located at /var/lib/ and /var/ispmysql.

To check if the old IP address is in the MySQL configuration file, run the following command:

Replace the old IP address with the new one in each file that was listed in the output of the previous command:

Actions in the panel

Change the IP address for all panel entities in the following sections:

  • Domains in the DNS management section
  • Sites in the Sites section
  • Database servers in the Databases - DB servers section, if remote access to them was enabled
  • Mail domains in the Mail - Mail domains section.