Archive for the ‘Control Panel’ Category

(Here, CentOS 5.8 with ip 10.100.1.2 and CentOS 6.3 with 10.100.1.3)

CentOS-5.8 is installing ISPConfig-3.0.3.3 and we will update to ISPConfig-3.0.4.6 on CentOS-6.3

Step1: Backup mailbox and dbispconfig database on CentOS 5.8

  • Backup all mailbox of users, mail domain

#tar czvf /backup/mailbox.tar.gz /var/mail

  • Backup dbispconfig database

#mysqldump -u root -p dbispconfig >/backup/dbispconfig.sql

#Enter password: …. (password of root user)

Step 2: Installing new CentOS 6.3 and configuring services

Step 3: Restore dbispconfig database and mailbox

  • Using phpmyadmin, drop all tables of dbispconfig databse and import the file dbispconfig.db to dbispconfig database

  • Or use:

    #mysql –host=localhost –user=root –password=XXXXXX < /var/download/dbispconfig.sql

  • Restore mailbox of all mail users

    #cd /

    #tar zxvf /var/download/mailbox.tar.gz

Step 4: Update to ISPConfig-3.0.4.6

  • Download ISPConfig-3.0.4.6.tar.gz (the present, it is lastest and stable version)

    #cd /var/dowload

    #rm -rf ispconfig3_install

    #wget http://prdownloads.sourceforge.net/ispconfig/ISPConfig-3.0.4.6.tar.gz

  • Executing update ISPConfig-3.0.3.3 to ISPConfig-3.0.4.6

    #tar zxvf ISPConfig-3.0.4.6.tar.gz

    #cd ispconfig3_install/install

    #php -q update.php

Here, User still have not login email. We need to tell Dovecot to use the file dovecot.conf that generated by ISPConfig /etc/dovecot.conf and not the default /etc/dovecot/dovecot.conf:

#cd /etc/dovecot

#mv dovecot.conf dovecot.conf.org

#ln -s ../dovecot.conf dovecot.conf

#/etc/init.d/dovecot restart

Here, we will have two servers: old-server is old ispconfig3 server and new-server is new ispconfig3 server that need to moved.

Step 1: Backup all sites code, databases and configuration files in old web hosting server

We need backup all site codes and databases that have in web hostingserver.

– Backup code

Compress folder /var/www (default folder that contain webs code ) . Naming compress file is codeweb.tar.gz

#cd /backup

#tar -pczf codeweb.tar.gz /var/www

(with -p parameter to same ownership when extract)

– Backup databases

Make a backup of all the mysql databases

#cd /backup

#mysqldump –opt –user=root –password=XXXXXX –all-databases | gzip >dbispconfig.sql.gz

NOTE: change XXXXXX to whatever your root password is

– Backup configuration files

We need to backup configuration files as php.ini, httpd.conf, passwd, group, shadow, postfix, dovecot, ..

#cd /

#cp -rf /etc/php.ini /etc/httpd.conf/ etc/passwd /etc/group /etc/shadow /etc/postfix/ /etc/dovecot* /backup

Step 2: Installing and configuring on the new ISPConfig3 server (new-server)

  • Installing a new CentOS server( new-server)

  • Moving codeweb.tar.gz and dbispconfig.sql.gz from old-server to new-server

    #scp /backup/webcode.tar.gz root@new-server:/var/download

    #scp /backup/dbispconfig.sql.gz root@new-server:/var/download

  • Moving configuration files from old-server to new-server

    #…

  • Installing services(Apache2, dovecot, ..) the following Installing ISPConfig-3 on Centos-6.x 86_64 (or see detail athttp://www.howtoforge.com/howtos/control-panels/ispconfig )and finish at step 23 (Install Squirrelmail), have not install step 24 (Install ISPConfig3, because we will import database ispconfig.sql that the sameispconfig version on old-server ).

  • And then, download the same ISPConfig version on the old-server (in here, the ispconfig version on the old-server is ispconfig-3.0.4.6, extract and install it

    #cd /var/download

    #wget http://prdownloads.sourceforge.net/ispconfig/ISPConfig-3.0.4.6.tar.gz

    #tar zxvf ISPConfig-3.0.4.6.tar.gz

    #cd ispconfig3_install/install

    #php -q install.php

Step3: Restore sites code and databases in new web hosting server

Log in the new-server, and perform to restore

1. Restore code

Changing to the / directory and extract code for all sites

cd /

#tar xvfz /var/download/codeweb.tar.gz

We will see all the web files start to uncompress into the /var/www/ directory
2. Restore database

#gzip -d dbispconfig.sql.gz

#mysql –host=localhost –user=root –password=XXXXXX < dbispconfig.sql

NOTE: change XXXXXX = to whatever is your root mysql password on the new-server

After we finished to restore, check ispconfig control panel https://new-server:8080 and login with admin account. Accounts will sync with the old-server.

Step 4: Notes

1. If have error occurs “ Username or Password wrong.1” when login with admin account then we do the following:

Get the password again:

#grep -i db_password /usr/local/ispconfig/interface/lib/config.inc.php

$conf[‘db_password’] = ‘d036658a01e0a5022290062523…’;

define(‘DB_PASSWORD’,$conf[‘db_password’]);

#mysql -u root -p

Enter password:

mysql>update mysql.user set password=PASSWORD(“d036658a01e0a5022290062523…”) where User=’ispconfig’;

mysql>flush privileges;

mysql>quit

2. If occur error when login system then copy and replace as passwd, group, shadow files

3. In ISPconfig interface, edit new-server ServerName and IP address

In the System module in ispconfig interface, edit ServerName to present server name( example new-server.example.com)

4. After restore, we still not see to appear vhost configuration files for sites, when do the following:

– Login admin account from https://new-server:8080

– Using the resyn function in the tool module in ispconfig

– Check to appear the vhost configuration files in /etc/httpd/conf/sites-available/ and /etc/httpd/conf/sites-enabled/

5. if occur errors with php, postfix, dovecot or dns when copy and replace the files as php.ini, main.cf, dovecot.conf, named.conf