Step 1
Install latest epelreository
For RHEL 6
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
For RHEL 7
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Install the required dependencies that mentioned below.
yum -y install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-suidperl openssh-clients expect perl-XML-RSS httpd
Step 2
For RHEL 6
Create a user for backuppc
useradd backuppc
passwd backuppc
Now install backuppc with below command
yum install BackupPC -y
Now set the password for BackupPC web portal
htpasswd -c /etc/BackupPC/apache.users backuppc
it will promt for password.
make some changes in /etc/httpd/conf.d/BackupPC.conf
It looks like below
AuthType Basic
AuthUserFile /etc/BackupPC/apache.users
AuthName "backuppc"
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require valid-user
<RequireAny>
Require local
</RequireAny>
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
order deny,allow
deny from all
#allow from 127.0.0.1
#allow from ::1
allow from all
# require valid-user
</IfModule>
Now make a copy the config file for backup
cp /etc/BackupPC/config.pl /etc/BackupPC/config.pl_bkp
now edit the config file
vi /etc/BackupPC/config.pl
Make a changes in the following lines
$Conf{ServerInitdPath} = '/etc/init.d/backuppc';
$Conf{ServerInitdStartCmd} = '$sshPath -p 222 -i /u01/BackupPC/ssh-BKPPC-key -q -x -l root $serverHost$serverInitdPath start';
$Conf{CgiAdminUsers} = 'backuppc';
also cross check the following
$Conf{ServerHost} = 'localhost';
$Conf{BackupPCUser} = 'backuppc';
$Conf{TopDir} = '/var/lib/BackupPC/';
$Conf{ConfDir} = '/etc/BackupPC/';
$Conf{LogDir} = '/var/log/BackupPC';
$Conf{InstallDir} = '/usr/share/BackupPC';
$Conf{CgiDir} = '/usr/share/BackupPC/sbin/';
For RHEL 7
yum install backuppc nfs-utils bzip2 -y
start the backuppc servives with below command
systemctl start backuppc.service
set the permission as below
cd /usr/share/BackupPC
chown backuppc:backuppc sbin/*
cd sbin/
chmod u+s BackupPC_Admin
usermod -s /bin/bash backuppc
Now edit the config file and made a changes like below
vi /etc/BackupPC/config.pl
$Conf{CgiAdminUsers} = ”;
to
$Conf{CgiAdminUsers} = ‘backuppc’;
and change another content like below
$Conf{PingPath} = ";
to
$Conf{PingPath} = ‘/bin/ping’;
Now edit the apache configuration like below
vi /etc/httpd/conf.d/BackupPC.conf
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require valid-user
<RequireAny>
Require valid-user
</RequireAny>
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
AllowOverride All
order deny,allow
deny from all
#allow from 127.0.0.1
#allow from ::1
#require valid-user
allow from all
</IfModule>
Create username and password for backuppc GUI with below command
htpasswd -c /etc/BackupPC/apache.users backuppc
Step 3
Grant passwordless sudo access for backuppc user
visudo
add the below line in last
Defaults !lecture
backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar
and # the following line
Defaults requiretty
to
#Defaults requiretty
Now start the httpd and backuppc
service httpd start
service backuppc start
now makes it enable
chkconfig httpd on
chkconfig backuppc on
Now access the backuppc in url
http://ipaddress/backuppc
Follow the link for ssh passwordless authentication with key file
http://raindocs.blogspot.com/2018/08/ssh-passwordless-authentication-with.html
and change the RsyncClientCmd and RsyncClientRestoreCmd like below
RsyncClientCmd:
$sshPath -p 222 -i /path/of/ssh-BKPPC-key -q -x -l root $host $rsyncPath $argList+
RsyncClientRestoreCmd:
$sshPath -p 222 -i /path/of/ssh-BKPPC-key -q -x -l root $host $rsyncPath $argList+
Now add the client to the backuppc server and start taking backup.
Install latest epelreository
For RHEL 6
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
For RHEL 7
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
Install the required dependencies that mentioned below.
yum -y install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-suidperl openssh-clients expect perl-XML-RSS httpd
Step 2
For RHEL 6
Create a user for backuppc
useradd backuppc
passwd backuppc
Now install backuppc with below command
yum install BackupPC -y
Now set the password for BackupPC web portal
htpasswd -c /etc/BackupPC/apache.users backuppc
it will promt for password.
make some changes in /etc/httpd/conf.d/BackupPC.conf
It looks like below
AuthType Basic
AuthUserFile /etc/BackupPC/apache.users
AuthName "backuppc"
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require valid-user
<RequireAny>
Require local
</RequireAny>
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
order deny,allow
deny from all
#allow from 127.0.0.1
#allow from ::1
allow from all
# require valid-user
</IfModule>
Now make a copy the config file for backup
cp /etc/BackupPC/config.pl /etc/BackupPC/config.pl_bkp
now edit the config file
vi /etc/BackupPC/config.pl
Make a changes in the following lines
$Conf{ServerInitdPath} = '/etc/init.d/backuppc';
$Conf{ServerInitdStartCmd} = '$sshPath -p 222 -i /u01/BackupPC/ssh-BKPPC-key -q -x -l root $serverHost$serverInitdPath start';
$Conf{CgiAdminUsers} = 'backuppc';
also cross check the following
$Conf{ServerHost} = 'localhost';
$Conf{BackupPCUser} = 'backuppc';
$Conf{TopDir} = '/var/lib/BackupPC/';
$Conf{ConfDir} = '/etc/BackupPC/';
$Conf{LogDir} = '/var/log/BackupPC';
$Conf{InstallDir} = '/usr/share/BackupPC';
$Conf{CgiDir} = '/usr/share/BackupPC/sbin/';
For RHEL 7
yum install backuppc nfs-utils bzip2 -y
start the backuppc servives with below command
systemctl start backuppc.service
set the permission as below
cd /usr/share/BackupPC
chown backuppc:backuppc sbin/*
cd sbin/
chmod u+s BackupPC_Admin
usermod -s /bin/bash backuppc
Now edit the config file and made a changes like below
vi /etc/BackupPC/config.pl
$Conf{CgiAdminUsers} = ”;
to
$Conf{CgiAdminUsers} = ‘backuppc’;
and change another content like below
$Conf{PingPath} = ";
to
$Conf{PingPath} = ‘/bin/ping’;
Now edit the apache configuration like below
vi /etc/httpd/conf.d/BackupPC.conf
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAll>
Require valid-user
<RequireAny>
Require valid-user
</RequireAny>
</RequireAll>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
AllowOverride All
order deny,allow
deny from all
#allow from 127.0.0.1
#allow from ::1
#require valid-user
allow from all
</IfModule>
Create username and password for backuppc GUI with below command
htpasswd -c /etc/BackupPC/apache.users backuppc
Step 3
Grant passwordless sudo access for backuppc user
visudo
add the below line in last
Defaults !lecture
backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar
and # the following line
Defaults requiretty
to
#Defaults requiretty
Now start the httpd and backuppc
service httpd start
service backuppc start
now makes it enable
chkconfig httpd on
chkconfig backuppc on
Now access the backuppc in url
http://ipaddress/backuppc
Follow the link for ssh passwordless authentication with key file
http://raindocs.blogspot.com/2018/08/ssh-passwordless-authentication-with.html
and change the RsyncClientCmd and RsyncClientRestoreCmd like below
RsyncClientCmd:
$sshPath -p 222 -i /path/of/ssh-BKPPC-key -q -x -l root $host $rsyncPath $argList+
RsyncClientRestoreCmd:
$sshPath -p 222 -i /path/of/ssh-BKPPC-key -q -x -l root $host $rsyncPath $argList+
Now add the client to the backuppc server and start taking backup.
No comments:
Post a Comment