Setting Up BackupPC On CentOS-7

Home » CentOS » Setting Up BackupPC On CentOS-7
CentOS 3 Comments

I’d be interested in any corrections or comments on the following instructions (basically for myself):

We assume that BackupPC has been installed:
sudo yum install BackupPC

1. BackupPC must be run by the user BackupPC. Accordingly the lines
User apache
Group apache in /etc/httpd/conf/httpd.conf should be changed to
User BackupPC
Group BackupPC

2. The user BackupPC must be able to SSH to root (to run rsync), since only root can access all the files on the system. This is slightly complicated because BackupPC has no default shell.
$ su
Passwd:
# su -s /bin/sh BackupPC
sh-4.1$ cd
sh-4.1$ ssh-keygen
Generating public/private rsa key pair.
sh-4.1$ cd .ssh
sh-4.1$ cp id_rsa.pub /tmp
sh-4.1$ exit
# cd
# ls .ssh If .ssh exists and contains id_rsa and id_rsa.pub ignore the next command
# ssh-keygen
Generating public/private rsa key pair.
# cd .ssh
# cat /tmp/id_rsa.pub >> authorized_keys
# su -s /bin/sh BackupPC
sh-4.1$ SSH -l root helen helen is the name of my server – substitute the correct name or IP address
# exit
sh-4.1$ exit
#

3. We must setup the graphic interface to BackupPC, since it is more or less impossible to administer BackupPC otherwise. I want to configure BackupPC from my laptop. My laptop and server are on the same network 192.168.2.0
# vi /etc/httpd/conf.d/BackupPC.conf Firstly, after the line
allow from 127.0.0.1
add
allow from 192.168.2.0/255.255.255.0
(giving the IP address of your network in place of 192.168.2.0). Secondly, change the line
Require local to
Require ip 192.168.2.0/255.255.255.0 127.0.0.1

4. Give BackupPC and yourself passwords to access BackupPC
# htpasswd -c /etc/BackupPC/apache.users BackupPC
Password:
# htpasswd -c /etc/BackupPC/apache.users yourusername
Password:
# exit

5. Ensure that all BackupPC files are owned by BackupPC.apache
# chown -R BackupPC.apache /etc/BackupPC /etc/httpd/conf.d/BackupPC.conf
/var/lib/BackupPC

6. Restart BackupPC and apache
# systemctl restart BackupPC
# systemctl restart httpd

7. Now see if you can access BackupPC on your server:
Browse to http://localhost/BackupPC
If this succeeds give username BackupPC and the password you chose for yourself above

8. Now try the same on your laptop:
Browse to http://helen/BackupPC
(substituting your server’s name or IP address for “helen”). Again give username BackupPC and the password you chose for yourself above.

9. Returning to the server,
# cd /etc/BackupPC
# vi hosts I appended the line
helen 0 BackupPC
to this file – you can choose any name here in place of helen it does not have to be the name of your server.

10. Now browse again to BackupPC, on laptop or server. Where it says “Select a host” give the name you just chose. Click on “Edit Config” and then on “Xfer”
and in the RsyncShareName line add the directory or directories on your server that you want to backup, and then click on Save.
(I chose /Photos, /common/tim and /var/www, but of course this is entirely up to you.)
Click on “helen Home” (substituting the name you chose above), and press “Start full backup”.

3 thoughts on - Setting Up BackupPC On CentOS-7

  • I am interested in understanding the thing with BackupPC. What does it have compared to basic rsync?
    – It has a webui

    Is it like a central backup server? if so, how it works with windows clients(if it is?)
    Just want to make sure.. I understood right.

    Why did you choose this over other software?

    Thanks, Eliezer

  • its a full blown backup service for any number of client hosts, it maintains a pool of full and incremental backups going back as far as you care, and this pool is fully dedupped to reduce its size. it uses rsync to fetch files from the target machines when making a new backup. the webui can be used to browse these backups and restore any portion of any backed up file system to any point at which there’s a backup.

    the ‘windows agent’ is a stripped down installation of rsyncd from cygwin.