Debianhelp.co.uk

Update VHCS 2.4.6.2 to VHCS 2.4.7 ISP Control Panel in Debian

This update we have divided in to several steps so that it will be easy to understand 

1)General Information

 Download the newest VHCS2 release using the following command

 # wget http://heanet.dl.sourceforge.net/sourceforge/vhcs/vhcs2.4.7.tar.bz2

Turn off the VHCS Daemon in your machine if it is running using the following command

# /etc/init.d/vhcs2_daemon stop

 Make a backup of the current VHCS files of your system

 # mv /var/www/vhcs2/gui/ /var/www/vhcs2/gui_bcp_yyyymmdd
 # cp /var/www/vhcs2/engine/ -R /var/www/vhcs2/engine_bcp_yyyymmdd

Unpack the downloaded archive using the following command

 #tar -xjf vhcs2.4.7.tar.bz2

2)Existing vhcs2.conf Update

This file is located at /etc/vhcs2/vhcs2.conf

 Lines to add

Search for MTA_SASLDB_FILE and add lines. The result should looks like this

MTA_SASLDB_FILE = /var/spool/postfix/etc/sasldb2

ETC_SASLDB_FILE = /etc/sasldb2

CMD_SASLDB_LISTUSERS2 = /usr/sbin/sasldblistusers2

CMD_SASLDB_PASSWD2 = /usr/sbin/saslpasswd2

Search for MAIL_TRAFF_LOG and add lines. The result should looks like this

MAIL_TRAFF_LOG = mail.log

MAIL_LOG_INC_AMAVIS = 0

PREV_TRAFF_LOG_MAX_SIZE = 10485760

QUOTA_ROOT_DIR = /var/www/vhcs2/engine/quota

Search for DATABASE_USER and add the line. The result should looks like this

DATABASE_USER = root

DATABASE_DIR = /var/lib/mysql

#
# Main situation variables;
#
 

Search for CMD_VHCS2D and add the line. The result should looks like this

CMD_VHCS2D = /etc/init.d/vhcs2_daemon

CMD_VHCS2N = /etc/init.d/vhcs2_network

#
# Server traffic manager
#
 

Search for CMD_POP and add the line. The result should looks like this

CMD_POP = /etc/init.d/courier-pop

CMD_AMAVIS = no

CMD_FTPD = /etc/init.d/proftpd

Search for COURIER_CONF_DIR and add the line. The result should looks like this

COURIER_CONF_DIR = /etc/courier

AUTHLIB_CONF_DIR = /etc/courier

CMD_MAKEUSERDB = /usr/sbin/makeuserdb

Set your default settings for traffic counting

If you are using AMAVIS and SPAMASSASSIN change

MAIL_LOG_INC_AMAVIS = 0

to

MAIL_LOG_INC_AMAVIS = 1

Set your default settings for spam and virus detection

If you are using AMAVIS change

CMD_AMAVIS = no

to

CMD_AMAVIS = /etc/init.d/amavis

 Change these following lines

BuildDate = 24.12.2005

VHCS_LICENSE = VHCS® Pro v2.4.7
build: 2005-12-24
Spartacus

Set permissions for vhcs2.conf (needed for autoresponder)

 # chmod 0644 /etc/vhcs2/vhcs2.conf
 

3)VHCS Daemon & init.d Update

Copy the new init.d file

 # cp -a /mydir/configs/init.d/vhcs2_daemon

Make the new daemon

 # cd /mydir/tools/daemon
 # make
 # cp ./vhcs2_daemon /var/www/vhcs2/daemon/vhcs2_daemon

Configuration file Update

Copy vhcs apache user logrotate script

 # cd /mydir/configs/logrotate/vhcs /etc/logrotate.d/vhcs2

4)VHCS Engine Update

Copy the new engine files

 # cp -a /mydir/engine/ /var/www/vhcs2/

Copy your crypt key from the old /engine_bcp_yyyymmdd/vhcs2-db-keys.pl to /engine/vhcs2-db-keys.pl

 # cp /var/www/vhcs2/engine_bcp_yyyymmdd/vhcs2-db-keys.pl /var/www/vhcs2/engine/vhcs2-db-keys.pl

changes for vhcs2-arpl-msgr
 

 # cp /var/www/vhcs2/engine/vhcs2-db-keys.pl /var/www/vhcs2/engine/messager/vhcs2-db-keys.pl

We changed sasldb2 management for the postfix chroot

So postfix had his own file in /var/spool/postfix/etc/sasldb2 and the system file is located in /etc/sasldb2.

If you DIDN'T have other apps running that are using /etc/sasldb2 you have to run following command:

 # cp /var/spool/postfix/etc/sasldb2 /etc/sasldb2

If you DID have other apps running that are using /etc/sasldb2 you don't have to run any command

5)Mailbox Engine Update

catchall adresses are moved from /etc/postfix/vhcs2/mailboxes to /etc/postfix/vhcs2/aliases

 # mv /etc/vhcs2/postfix/working/mailboxes /etc/vhcs2/postfix/working/mailboxes-SAVE
# cp /mydir/configs/postfix/working/mailboxes /etc/vhcs2/postfix/working/mailboxes

6)Backup Engine Update

 Remove old file if they already exists

 # rm /var/www/vhcs2/engine/tools/vhcs2-backup-all

Check and maybe change the crontab line for the backup if line looks like:

/var/www/vhcs2/engine/tools/vhcs2-backup-all yes &>/var/log/vhcs2/vhcs2-backup-all-mngr.log

change it too:

/var/www/vhcs2/engine/backup/vhcs2-backup-all yes &>/var/log/vhcs2/vhcs2-backup-all-mngr.log

7)Traffic Engine Update

 Delete old log analyzing tool

# rm /usr/sbin/pflogsumm.pl
# rm -R /var/www/vhcs2/engine/traffic/pflogsumm-1.0.10
# rm -R /var/www/vhcs2/engine/traffic/pflogsumm-1.1.0

Changes specially for SuSE

 # mv /var/www/vhcs2/engine/traffic/vhcs2-vrl-traff /var/www/vhcs2/engine/traffic/vhcs2-vrl-traff-DEBIAN

 # mv /var/www/vhcs2/engine/traffic/vhcs2-vrl-traff-SUSE /var/www/vhcs2/engine/traffic/vhcs2-vrl-traff

 Delete backup-lock file if it exit

 # rm /tmp/vhcs2-backup-all.lock

8)Engine Templates Update

Update postfix template make the config working also with postfix 2.2
 

# mv /etc/postfix/master.cf /etc/postfix/master.cf-SAVE
# cp /mydir/configs/postfix/master.cf /etc/postfix/master.cf

Now compare both files and put your special config entries and domain names / IP etc

Update proftpd config file (added "DelayEngine off")

 # mv /etc/proftpd.conf /etc/proftpd.conf-SAVE
 # cp /mydir/configs/proftpd/proftpd.conf /etc/proftpd.conf

Now compare both files and put your special config entries and domain names / IP etc.

Update apache templates part for domains (vhosts skeleton and errorpages)

 # cp /mydir/configs/apache/parts/als_entry.tpl /etc/vhcs2/apache/parts/
 # cp /mydir/configs/apache/parts/dmn_entry.tpl /etc/vhcs2/apache/parts/
 # cp /mydir/configs/apache/parts/sub_entry.tpl /etc/vhcs2/apache/parts/
 # cp /mydir/configs/apache/parts/vh_entry.tpl /etc/vhcs2/apache/parts/
 # cp /mydir/configs/apache/parts/vhcs2_base.tpl /etc/vhcs2/apache/parts/

Save the old vhcs2 apache conf. Because will rebuild it completly

 # mv /etc/vhcs2/apache/working/vhcs2.conf /etc/vhcs2/apache/working/vhcs2-SAVE.conf

Update bind templates part for domains

 # cp /mydir/configs/bind/parts/db_e.tpl /etc/vhcs2/bind/parts/

9)Finish Engine Updates

Set correct engine permissions

 # /var/www/vhcs2/engine/setup/set-engine-permissions.sh

10)GUI Update

Copy the new GUI files

# cp -a /mydir/gui/ /var/www/vhcs2/

Copy your crypt key from the old /gui_bcp_yyyymmdd/include/vhcs2-db-keys.php

to /gui/include/vhcs2-db-keys.php

# cp /var/www/vhcs2/gui_bcp_yyyymmdd/include/vhcs2-db-keys.php

/var/www/vhcs2/gui/include/vhcs2-db-keys.php

 Password reminder
 

install GD library

 # apt-get install php4-gd

Apache restart

 # apache2ctl graceful

Set correct gui permissions

 # /var/www/vhcs2/engine/setup/set-gui-permissions.sh

copy gui/errordocs/index.php in all client errordoc directories

A fixed XSS (Cross-Site-Scripting) bug in that file

11)Database Update

Updated language tables could be updated by importing the languages.sql For example with phpmyadmin or over commandline. File is located in configs/database/languages.sql

Change status for all mail-addresses because of rebuild SASLDB2 and MD5 passwords

UPDATE `vhcs2`.`mail_users` SET `status` = 'change' WHERE `status` = 'ok';

Change status for rebuild apache conf for all domains

UPDATE `vhcs2`.`subdomain` SET `subdomain_status` = 'change' WHERE `subdomain_status` = 'ok';
UPDATE `vhcs2`.`domain` SET `domain_status` = 'change' WHERE `domain_status` = 'ok';
UPDATE `vhcs2`.`domain_aliasses` SET `alias_status` = 'change' WHERE `alias_status` = 'ok';

Update field settings

ALTER TABLE `vhcs2`.`hosting_plans` CHANGE  `price`  `price` DECIMAL( 10, 2 )

NOT NULL DEFAULT  '0.00';
ALTER TABLE `vhcs2`.`hosting_plans` CHANGE  `setup_fee`  `setup_fee` DECIMAL( 10, 2 ) 
NOT NULL DEFAULT  '0.00';

ALTER TABLE `vhcs2`.`admin` ADD `uniqkey` varchar(255);

 Now you should execute the VHCS engine manually, because users/customers may have made system changes during your update operation

This will take a moment

# /var/www/vhcs2/engine/vhcs2-rqst-mngr

Now you can start the VHCS daemon
 # /etc/init.d/vhcs2_daemon start

VHCS is successfully updated now