start httpd
via CPAN insaql the following per file
perl-MCPN -e shell
install Compress::Zlib
install Archive::Zip
File::RsyncP
Install the following packages
yum install perl-suidperl
Now we add a user for the backupPC with its group being apache useradd -g apache backuppc
Now we download the backupPC source file
cd /usr/local/src wget http://nchc.dl.sourceforge.net/sourceforge/backuppc/BackupPC-3.1.0.tar.gz
now we will copy the init scritp to the right location
(A) Now backing up frm Linux clinet to linux BackupPC
Passwordless login frm linux clinet and from Linux BackupPC server
now on the Linux BackupPC server ( su - backuppc ) try to login in ( ssh root@linuxclinet ) , it should log you in without a password You can append as many public keys
htpasswd -c /etc/BackupPC/htpasswd client1 ( unix system user ) ---------> enter the password as prompted
now we will add our clinet to the host file located in /etc/BackupPC/hosts
# host dhcp user moreUsers # <--- do not edit this line #farside 0 craig jill,jeff # <--- example static IP host entry #larson 1 bill # <--- example DHCP host entry 192.168.0.244 0 linuxclient1 # <--- where only linuxclinet1 user can acces this system back up frm webinterfce 192.168.0.209 0 backuppc # <--- where only backuppc user can acces this system back up frm webinterfce
we will create/edit a congif file in /etc/BackupPC/pc/linuxclientPCIP.pl
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{RsyncClientCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+'; $Conf{XferMethod} = 'rsync'; $Conf{RsyncShareName} = ['/home','/var/log']; now we will edit he httpd.conf so that only the prticulat user assigned to the particular clinet gets access to the cgi script
<Directory "/var/www/cgi-bin"> # AllowOverride None # Options None # Order allow,deny # Allow from all Options ExecCGI FollowSymlinks AddHandler cgi-script .cgi DirectoryIndex index.cgi AuthGroupFile /etc/backuppc/htgroup AuthUserFile /etc/backuppc/htpasswd AuthType basic AuthName "backuppc" require valid-user
</Directory>
now we restart httpd and backuppc
/etc/init.d/httd restart /etc/init.d/backuppc restart
add the user name and password .... this should gvive u access to the particular clinet
(B) Now backing up frm Windows clinet to linux BackupPC
#this is frm where all your data will be backed up.
[cDrive0] path = c:/rsyncd comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
[cDrive1] path = c:/var comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
[cDrive2] path = c:/Documents and Settings/All Users/Documents/My Music comment = agnello's documents auth users = agnello secrets file = c:/rsyncd/rsyncd.secrets # hosts allow = 172.16.0.17 strict modes = false read only = false list = false
Now save the file and run the service.bat file make sure that your windows PC has not blocked 873
Now edit the rsync.secret add the following lines
agnello:agnello123
now on the Linux BackuPC server we create a config file for the windows client
eg : vi /etc/BackupPC/pc/windowsclentip.pl $Conf{XferMethod} = 'rsyncd'; $Conf{RsyncdUserName} = 'agnello'; $Conf{RsyncdPasswd} = 'agnello123'; $Conf{RsyncShareName} = ['cDrive0','cDrive1','cDrive2']; $Conf{ClientCharset} = 'cp1252'
maker sure that the user and password is tha same as rsync.secret file
now we will add our windows clinet to the host file located in /etc/BackupPC/hosts on the lINUX bACKUPpc SERVER
# host dhcp user moreUsers # <--- do not edit this line #farside 0 craig jill,jeff # <--- example static IP host entry #larson 1 bill # <--- example DHCP host entry 192.168.0.244 0 linuxclient1 # <--- where only linuxclinet1 user can acces this system back up frm webinterfce 192.168.0.209 0 winclient1 # <--- where only backuppc user can acces this system back up frm webinterfce
now we restart backuppc
/etc/init.d/backuppc restart
now try browser in the the http://linuxBackupPCserverIP/cgi-bin/backupc
add the user name and password .... this should gvive u access to the particular clinet ( ref /etc/BackupPC/hosts file )
No comments:
Post a Comment