Thursday, 29 December 2011

< rsync >process to restore accounts from old drive


Direct Admin rsync process to restore accounts from old drive :::----

-------**********-------------********-----------*******--------------

#Transfer /home data

rsync -av --progress /backup/root/home /


#Transfer important files from /etc drive.

rsync -av --progress /backup/root/etc/passwd /etc
rsync -av --progress /backup/root/etc/shadow /etc
rsync -av --progress /backup/root/etc/group /etc
rsync -av --progress /backup/root/etc/exim.conf /etc
rsync -av --progress /backup/root/etc/exim.pl /etc
rsync -av --progress /backup/root/etc/system_filter.exim /etc
rsync -av --progress /backup/root/etc/exim.crt /etc 
rsync -av --progress /backup/root/etc/exim.key /etc
rsync -av --progress /backup/root/etc/proftpd.conf /etc
rsync -av --progress /backup/root/etc/proftpd.vhosts.conf /etc
rsync -av --progress /backup/root/etc/proftpd.passwd /etc
rsync -av --progress /backup/root/etc/hosts /etc
rsync -av --progress /backup/root/etc/resolve.conf /etc
rsync -av --progress /backup/root/etc/named.conf /etc


rsync -av --progress /backup/root/etc/virtual/domainowners /etc/virtual
rsync -av --progress /backup/root/etc/virtual/domains /etc/virtual
rsync -av --progress /backup/root/etc/virtual/pophosts /etc/virtual


rsync -av --progress /backup/etc/virtual/majordomo/* /etc/virtual/majordomo



# Transfer HTTPD and configuration files

rsync -av --progress /backup/etc/httpd/conf/httpd.conf /etc/httpd/conf
rsync -av --progress /backup/etc/httpd/conf/ips.conf /etc/httpd/conf
rsync -av --progress /backup/root/etc/httpd/conf/ssl.crt /etc/httpd/conf

rsync -av --progress /backup/etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key


# Transfer logs and databases

rsync -av --progress /backup/var/named/* /var/named/
rsync -av --progress /backup/var/spool/virtual/* /var/spool/virtual
rsync -av --progress /backup/var/spool/mail/* /var/spool/mail
rsync -av --progress /backup/var/spool/cron/* /var/spool/cron
rsync -av --progress /backup/var/www/* /var/www
rsync -av --progress /backup/var/log/* /var/log
rsync -av --progress /backup/var/lib/mysql/* /var/lib/mysql


# Transfer frontpage config files

rsync -av --progress /backup/usr/local/frontpage/*.cnf /usr/local/frontpage

# Transfer directadmin configuration and user files

rsync -av --progress /backup/usr/local/directadmin/* /usr/local/directadmin


Cpanel :---

rsync -vrplogDtH /mnt/old/usr/local/apache/conf /usr/local/apache
rsync -vrplogDtH /mnt/old/var/named /var
rsync -vrplogDtH /mnt/old/home/* /home
rsync -vrplogDtH /mnt/old/usr/local/cpanel /usr/local
rsync -vrplogDtH /mnt/old/var/lib/mysql /var/lib
rsync -vrplogDtH /mnt/old/var/cpanel /var
rsync -vrplogDtH /mnt/old/usr/share/ssl /usr/share
rsync -vrplogDtH /mnt/old/var/ssl /var
rsync -vrplogDtH /mnt/old/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty
rsync -vrplogDtH /mnt/old/var/log/bandwidth /var/log
rsync -vrplogDtH /mnt/old/usr/local/frontpage /usr/local
rsync -vrplogDtH /mnt/old/var/spool/cron /var/spool

-------------------------------********************************-------------------------------------

Sunday, 18 December 2011

Retry time out Error


<<< Insruction and steps are as follows  >>> :--

********************--------*************************

[root@server ~]# cd /var/spool/exim/db
[root@server db]# ll
total 66664
-rw-r-----  1 mailnull mail    12288 Jun 26 02:47 callout
-rw-r-----  1 mailnull mail    12288 Jun 26 02:47 misc
-rw-r-----  1 mailnull mail 79605760 Aug  5 11:46 ratelimit
-rw-r-----  1 mailnull mail        0 Jun 26 02:47 ratelimit.lockfile
-rw-r-----  1 mailnull mail   167936 Aug  5 11:45 retry
-rw-r-----  1 mailnull mail        0 Jun 26 02:49 retry.lockfile
-rw-r-----  1 mailnull mail    45056 Aug  5 11:45 wait-remote_smtp
-rw-r-----  1 mailnull mail        0 Jun 26 02:58 wait-remote_smtp.lockfile
[root@server db]# rm retry
rm: remove regular file `retry'? y
[root@server db]# rm retry.lockfile
rm: remove regular empty file `retry.lockfile'? y
[root@server db]# rm  wait-remote_smtp
rm: remove regular file `wait-remote_smtp'? y
[root@server db]# rm wait-remote_smtp.lock
rm: cannot lstat `wait-remote_smtp.lock': No such file or directory
[root@server db]# rm wait-remote_smtp.lockfile
rm: remove regular empty file `wait-remote_smtp.lockfile'? y
[root@server db]# service exim restart
Shutting down exim: [  OK  ]
Shutting down spamd: [  OK  ]
Starting exim-26: [  OK  ]
Starting exim: [  OK  ]
Starting exim-smtps: [  OK  ]
[root@server db]# sendmail -v "ncarey@sympatico.ca"

--------------------------------------------------------

Wednesday, 14 December 2011

Restore c-panel data from secondary drive using ( rsync )

*-* Just follow the given instruction *-* :--

*********************

# /etc User / IP's + passwd files

rsync -av --progress /oldhd/etc/passwd /etc/

rsync -av --progress /oldhd/etc/shadow /etc/

rsync -av --progress /oldhd/etc/group /etc/

rsync -av --progress /oldhd/etc/wwwacct.conf /etc/

rsync -av --progress /oldhd/etc/quota.conf /etc/

rsync -av --progress /oldhd/etc/domainalias /etc/

rsync -av --progress /oldhd/etc/remotedomains /etc/

rsync -av --progress /oldhd/etc/reservedipreasons /etc/

rsync -av --progress /oldhd/etc/reservedips /etc/

rsync -av --progress /oldhd/etc/secondarymx /etc/
rsync -av --progress /oldhd/etc/localdomains /etc/
rsync -av --progress /oldhd/etc/userdomains /etc/
rsync -av --progress /oldhd/etc/valiases /etc/
rsync -av --progress /oldhd/etc/vfilters /etc/
rsync -av --progress /oldhd/etc/vmail /etc/
rsync -av --progress /oldhd/etc/trueuserdomains /etc/
rsync -av --progress /oldhd/etc/ips /etc/
rsync -av --progress /oldhd/etc/domainips /etc/
rsync -av --progress /oldhd/etc/services /etc/



ftpd files

rsync -av --progress /oldhd/etc/sysconfig/pure-ftpd /etc/sysconfig/
rsync -av --progress /oldhd/etc/pure-ftpd.conf /etc/
rsync -av --progress /oldhd/etc/pure-ftpd /etc/
rsync -av --progress /oldhd/etc/proftpd /etc/
rsync -av --progress /oldhd/etc/proftpd.* /etc/

# /var

rsync -av --progress /oldhd/var/cpanel /var/
rsync -av --progress /oldhd/var/spool/cron /var/spool/
rsync -av --progress /oldhd/var/netenberg /var/



# /usr config - 3rdparty

rsync -av --progress /oldhd/usr/share/ssl /usr/share/
rsync -av --progress /oldhd/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty/
rsync -av --progress /oldhd/usr/local/cpanel/base/frontend /usr/local/cpanel/base/



# Apache

rsync -av --progress /oldhd/usr/local/apache/conf /usr/local/apache/
rsync -av --progress /oldhd/usr/local/frontpage /usr/local/



# Mysql config

rsync -av --progress /oldhd/root/.my.cnf /root/
rsync -av --progress /oldhd/etc/my.cnf /etc/



# Named

rsync -av --progress /oldhd/var/named /var/
rsync -av --progress /oldhd/etc/named.conf /etc/
rsync -av --progress /oldhd/etc/rndc.conf /etc/



# Mysql

rsync -av --progress /oldhd/var/lib/mysql /var/lib/




-*-*-*-*-*-*-*-*-*-*-*


#for RSYNC of home create  a sh file add the following lines, execute the file as sh file.sh


for SITE in `ls /oldhd/var/cpanel/users`

do

rsync -av --progress /oldhd/home/* /home/

done



rsync -av --progress /oldhd/etc/trueuserowners /etc/

exec,passthru,system,proc_open,popen

Saturday, 3 December 2011

HOW TO RESET MYSQL PASSWORD

STEPS ARE AS FOLLOWS **// :-

< How to reset Mysql root password on directadmin server > :--


#mysql --user=`grep "^user=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2` --password=`grep "^passwd=" /usr/local/directadmin/conf/mysql.conf | cut -d= -f2`


mysql>use mysql


mysql>update user set password=PASSWORD("newpassword") where User='root';

Sunday, 20 November 2011

what is openvz

*-* Just follow the below commands -*- :-

-------------------================----------------------------

  106  vzctl create 215 --ostemplate centos-5-i386-default --config vps.basic
  107  vzctl set 215 --onboot yes --save
  108  vzctl set 215 --hostname hk05.sinoservers.com --save
  109  vzctl set 215 --ipadd 91.207.192.206 --save
  110  vzctl set 215 --numothersock 120 --save
  111  vzctl start 215
  112  vzlist
  113  vzctl set 215 --diskspace 15G:17G --save
  114  ifconfig 
  115  vzlist
  116  vzctl set 215 --diskspace 5G:7G --save
--------------***********--------------

Thursday, 10 November 2011

Park error ( Cannot create addon domain )

---- Just follow the given instruction  ---- ::

/var/cpanel/users/username

/scripts/updateuserdomains
/var/named/domain.db
/etc/named.conf
/usr/local/apache/conf/httpd.conf
/etc/localdomains
/etc/userdomains
/etc/trueuserdomains
/etc/trueuserowners
/etc/valiases/domain.com
/etc/vdomainaliases/domain.com
/etc/vfilters/domain.com

************-------------------

If an etc directory exists for the addon it will fail.

************----------------------
rm -Rf /home/username/etc/domain.com/
 
*****************************************************

Monday, 31 October 2011

open a port in linux


--- Follow the command given below --- :-


**********-------------*********

How to open port 21 in iptables ::

-------------------------

root@fs8 [/home]# iptables -I INPUT -p tcp -i eth0 --dport 2222 -j ACCEPT

Tuesday, 25 October 2011

Steps to setting up VPS quota


I do see what you are referring to, and I think this is going to have to do with the quota settings on the VPS. .

//**Ensure the following steps have been completed, and let me know if you have any other questions.>:-

After installing cPanel the following steps to be executed if less than 500 accounts users/groups are going to be hosted:
You should perform the following steps in Parallels Management Console :--

-- Please keep in mind we are not able to directly support the administration and setup of a VPS, and 
   therefore take no responsibility for the use of the following steps.

***************************

1). Open the Properties window of the needed Container by right-clicking
    the corresponding Container line in the right pane of the Parallels Management Console window.

2). Select the Resources tab in the Properties window of the selected Container.

3). In the left pane, select Disk Quota.

4). Double click on quotaugidlimit on the right panel.

5). Uncheck "2nd level quota off" if it is checked already.

6). Set the hard limit value of quotaugidlimit to 1000.

7). Click the OK button on all open Windows.

8). If you are promoted for rebooting the VE, accept it. Else manually reboot the VE.

    Once reboot is completed,login to cPanel and run the Initial Quota Setup. Now the quotas should be working fine.

Monday, 24 October 2011

MySQL-Sock


/** Just follow the command given below **//:--

---------------------------------------

** First check if you have Spanned processes for mysql by the following command :--

netstat -apn or ps -aux 

Then.. 

service mysql stop 

Check for any mysql PID and give the following command with the Process ID 

kill -9 PID 

killall -e -9 mysqld 

Once the process is killed mysql is cleaned from the server. 

Check under /tmp partition if you the socket file created like ( mysql.sock --> /var/lib/mysql/mysql.sock ) If not then.. 

************************************************************

//**Do the following :--

touch /var/lib/mysql/mysql.sock 

chmod 0777 /var/lib/mysql/mysql.sock

Then under /tmp 

ln -s /var/lib/mysql/mysql.sock mysql.sock ( this command will create the socket linked to /var/lib/mysql/ ) 

Finally restart mysql server if the problem still persist try to increase the mysql connections from /etc/my.cnf

Saturday, 15 October 2011

Mount hard drive


 ** follow the given instruction  :--

root@server [~]# fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 14593 117218241 83 Linux

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 535 4192965 82 Linux swap / Solaris
/dev/sda3 536 19457 151990965 83 Linux


Once detected, /dev/hda1, just mount it using mount /dev/hda1 /backup assuming that the backup folder is already in place

root@server [/]# mount /dev/hda1 /backup/

root@server [/]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 141G 16G 118G 12% /
/dev/sda1 99M 11M 83M 12% /boot
tmpfs 1008M 0 1008M 0% /dev/shm
/usr/tmpDSK 485M 11M 449M 3% /tmp
/dev/hda1 111G 188M 105G 1% /backup


So the secondary drive has been mounted as /backup.

Now to make it permanent you will need to edit /etc/fstab.

/dev/hda1 /backup ext3 defaults 1 1

***********

Mounted and completed.


[Note] :--

Please keep this information in your KB for future reference