Current time: 11-25-2024, 06:11 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] VHCS System Rebuild
Author Message
grungy Offline
Junior Member
*

Posts: 190
Joined: Dec 2006
Reputation: 6
Post: #1
[HowTo] VHCS System Rebuild
Found it in google cache:

VHCS System Rebuild

If you liked to generate again various VHCS system entries, (e.g. after Apache and/or Bind Template adjustments) you proceed as follows:

Make changes into the VHCS Templates - Apache, bind, etc. and/or in vhcs2.conf (e.g.. Secondary DNS change).

Then you sould set ?[Domain status] in the VHCS database to "CHANGES", for the Domain which are to be updated and/or rebuilt. Launch the ?[VHCS engine] manually, then then desired system entries are generated again and your changes will applied.

IE, to rebuild dns files :

Code:
root#/etc/init.d/vhcs2_daemon stop
    root#mysql -u root -p<password>
    mysql>USE vhcs2
    mysql>UPDATE `domain` SET `domain_status` = 'change' WHERE `domain_status` = 'ok';
    mysql>UPDATE `domain_aliasses` SET `alias_status` = 'change' WHERE `alias_status` = 'ok';
    mysql>UPDATE `subdomain` SET `subdomain_status` = 'change' WHERE `subdomain_status` = 'ok';
    mysql>quit
    root#/var/www/vhcs2/engine/vhcs2-rqst-mngr
    root#/etc/init.d/vhcs2_daemon start


You should note that this Procedure only for Domain, then Domain alias and at the end for Subdomains.
(This post was last modified: 04-11-2007 08:57 PM by grungy.)
04-11-2007 08:56 PM
Visit this user's website Find all posts by this user Quote this message in a reply
chanwork Offline
Junior Member
*

Posts: 19
Joined: Oct 2006
Reputation: 0
Post: #2
RE: [HowTo] VHCS System Rebuild
When you name this System Rebuild you need more!

Code:
UPDATE domain SET domain_gid = "0";
UPDATE domain SET domain_uid = "0";
UPDATE domain SET domain_status = "toadd";
UPDATE subdomain SET subdomain_status = "toadd";
UPDATE domain_aliasses SET alias_status = "toadd";
update mail_users set status = "toadd";
TRUNCATE TABLE `auto_num`;
update htaccess_groups set status = "toadd";
update htaccess_users set status = "toadd";

now, when you have only (my backup script) the SQL.gz files

->> http://www.isp-control.net/forum/backup-...t-360.html

you musst create all databases again! (DONT FORGET THE MYSQL DB! The Users are stored there!

Code:
<?php


mysql_connect("localhost","root","ROOTPASS") or die ("ERROR");

mysql_select_db("vhcs2") or die ("Die Datenbank existiert nicht");


  $ergebnis = mysql_query("SELECT * FROM sql_database order by sqld_id DESC");
  
  while($row = mysql_fetch_row($ergebnis))
  
  {
  $dbnamealt = $row[2];
  echo "$dbnamealt<br>";
  
  mysql_query("CREATE DATABASE `$dbnamealt`");
  
  
  }
?>

Dumps gzip -d *

Code:
MYSQL DUMPS IMPORTIEREN

#!/bin/sh
ROOTPASS="XXXXX"
RESTORELIST=`find  -name "*.sql" -maxdepth 1`
for i in $RESTORELIST
do
dateiname=$(echo $i | sed -e "s/\....$//")
dateiname=${dateiname:2}
mysql $dateiname < $dateiname.sql -p$ROOTPASS
done

echo FERTIG RESTORE!!

When you use my Backup Script

Code:
# BACKUPS IN DIE KUNDENORDNER SCHIEBEN

#!/bin/sh
RESTORELIST=`find  -name "*.tar.gz" -maxdepth 1`
for i in $RESTORELIST
do
dateiname=$(echo $i | head -c -33)
dateiname=${dateiname:2}
echo $dateiname
original=${i:2}
mv $original /var/www/virtual/$dateiname/backups/$dateiname.tar.gz
chmod 660 /var/www/virtual/$dateiname/backups/$dateiname.tar.gz
rm /var/www/virtual/$dateiname/htdocs/index.html
done

echo FERTIG RESTORE!!

NOW!
Code:
UPDATE domain SET domain_status = "restore";

Request Manager start!!

->
OWNER Neusetzen!
Code:
## KUNDEN ORDNER NACHDEM RESTORE OWNER:GROUP SETZEN ;)

#!/bin/sh
CHOWN=`cat /etc/passwd | grep "vu2"`
for i in $CHOWN
do
OWNER=$(echo $i | cut -d ":" -f -1)
PFAD=$(echo $i | cut -d ":" -f 6)  
GROUP=www-data

chown $OWNER:$GROUP $PFAD/ -R
echo $OWNER:$GROUP $PFAD/
done

## BACKUPS DEL!!

Code:
#!/bin/sh
RESTORELIST=`find /var/www/virtual/ -name "*.*" -maxdepth 1`
for i in $RESTORELIST
do
cd $i/backups/ && rm *.tar.gz
echo $i
done

echo FERTIG RESTORE!!

any ideas?
(This post was last modified: 04-11-2007 09:16 PM by chanwork.)
04-11-2007 09:12 PM
Find all posts by this user Quote this message in a reply
grungy Offline
Junior Member
*

Posts: 190
Joined: Dec 2006
Reputation: 6
Post: #3
RE: [HowTo] VHCS System Rebuild
chanwork good work!

I found that tutorial in google cache and since it is useful it would be a shame not to have it here. It is useful if you changed your DNS template, like your NS1 and NS2 and somehow want to update all DNS zones automatically, that's want VHCS to do it for you.
04-11-2007 09:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Daff Offline
Junior Member
*

Posts: 37
Joined: Oct 2006
Reputation: 0
Post: #4
RE: [HowTo] VHCS System Rebuild
You saved me. That's what I was searching for Smile
05-30-2007 05:11 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)