Google Plus

Install BackupPC server in Centos|Rhel|Fedora

Written by Mel Kham on . Posted in Unix Tutorials

BackupPC is an entirely disk-based backup and recovery system. It offers a number of advantages, some of which are available only with BackupPC,

Backuppc Support any client OS and has a Web interface to allows user control of and access to backups

How BackupPC Works

The BackupPC model has one user per client. This fits the usage pattern of the type of environment it was specifically designed for: backing up several users’ PCs (hence the name). This should typically be the user who owns the data on the machine. In the case of a large file server, it should be an administrator. BackupPC emails the owner if it cannot back up the client after a configurable time, and the owner can control restores using the web interface. The following list describes how BackupPC works.

Now we will show you how install Backup pc on Centos/Rhel/Fedora, the current installation is done on a machine with CentOS 5.2 installed, but it work also for fedora and RHEL.

Open your terminal, and under root type :

 yum install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSS httpd
 rpm  -Uvh   http://dev.centos.org/centos/5/testing/i386/RPMS/backuppc-3.1.0-1.el5.centos.i386.rpm

1- Add user backuppc to your machine, User backuppc will be created upon installation. Change apache user to backuppc.

 vi /etc/httpd/conf/httpd.conf

 

Change ‘User apache‘ to ‘User backuppc

Save

2- Edit file /etc/httpd/conf.d/backuppc.conf

 # vi /etc/httpd/conf.d/backuppc.conf   

 

change ‘Allow from 127.0.0.1‘ to ‘Allow from all

Save

3- Create password for cgi-bin admin user

# htpasswd -c /var/lib/backuppc/passwd/htpasswd admin

4- Edit backuppc config file

# vi /etc/BackupPC/config.pl 
Find and change accordingly
$Conf{ServerHost} = 'localhost';
$Conf{SplitPath} = '/usr/bin/split';
$Conf{CatPath} = '/bin/cat';
$Conf{GzipPath} = '/bin/gzip';
$Conf{Bzip2Path} = '/usr/bin/bzip2';
$Conf{BackupPCUser} = 'backuppc';
$Conf{TopDir} = '/var/lib/backuppc';
$Conf{ConfDir} = '/etc/BackupPC';
$Conf{LogDir} = '/var/log/BackupPC';
$Conf{InstallDir} = '/usr';
$Conf{CgiDir} = '/usr/share/backuppc/cgi-bin';
$Conf{ServerInitdPath} = '/etc/init.d/backuppc';
$Conf{ServerInitdStartCmd} = '$sshPath -q -x -l root $serverHost$serverInitdPath start';
$Conf{SshPath} = '/usr/bin/ssh';
$Conf{NmbLookupPath} = '/usr/bin/nmblookup';
$Conf{PingPath} = '/bin/ping';
$Conf{CgiAdminUsers} = 'admin';

Save

5- Grant passwordless sudo for user backuppc to run /bin/gtar and /bin/tar

# visudo

 

Add these entries :

Defaults !lecture # to disable lecture

backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

Comment this entry

#Defaults requiretty

Save and exit

Restart apache and backuppc service

# /etc/init.d/http restart
# /etc/init.d/backuppc restart

 

Open your browser and point it to ‘http://backuppc_server_ip/backuppc‘ and you should see the backuppc web interface

 

After this, you have to do almost all the configuration through the web interface. To test, you can run localhost backup first. You have to create the host, fill up all the setting and you are ready to go. Record the host and ip in /etc/hosts.

II Client setup

1 – Create new user

# useradd backupuser
# passwd backupuser

2- Grant passwordless sudo for user backupuser

# visudo
Add these entries

Defaults !lecture # to disable lecture

backupuser ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

Comment this entry

#Defaults requiretty

Save

3- From the server using backuppc user, create ssh public key

# su -s /bin/bash backuppc
$ mkdir .ssh
$ chown backuppc.backuppc .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
$ ssh-copy-id -i .ssh/id_rsa.pub backupuser@client

4 – To make sure that the 3rd step is a success, try to ssh to backupuser@client using backuppc user from the server. If no password is asked, then you are ready.

# su -s /bin/bash backuppc
$ ssh backupuser@client

You can start entering the client to the list of host and start backing up :)

If something didnt work , please post it in the forum

If you need support to install Backup pc on Ubuntu, just post your request in the comment bellow.

{loadposition user9}

Related Articles By Tags :

{loadposition user1}

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • Ivan

    Hello,

    I am trying to install backupPC following your how-to but i always get this message:

    perl(XML::RSS) is needed by backuppc-3.0.0-1.el4.centos.i386

    I did install it via CPAN:
    cpan> install XML::RSS
    CPAN: Storable loaded ok
    Going to read /root/.cpan/Metadata
    Database was generated on Mon, 26 Oct 2009 09:28:19 GMT
    XML::RSS is up to date.

    But still getting the same message…

    Any suggestion??

    –Ivan.

  • lamauser
  • Ivan

    Hello,

    I did install the XML::RSS via rpm and it worked fine (i did it before using the cpan console) and this time it did work! =]]
    Now im trying to get into the web console but the user admin seems to not be working… I tried with
    htpasswd -c /var/lib/backuppc/passwd/htpasswd admin
    but is not working.
    Any thoughts??

  • pirat9

    Ivan.
    try with other user
    htpasswd -c /var/lib/backuppc/passwd/htpasswd yourname

    and let me now if it works

  • Ivan

    Hello,

    Thx for the replies.. I did get into the web interface, at the beginning was getting this message in the apache log:

    (13)Permission denied: Could not open password file: /var/lib/backuppc/passwd/htpasswd

    I have changed the topDir location and maybe it was permission related, I change back the topDir location and now is working.
    But now when i got into the web interface, if I click on the status, host summary, logs or email summary i get the following error:

    Error: Unable to connect to BackupPC server

    I am able to access the config, hosts or admin options though.

    I will appreciate your comments.

    –Ivan.

  • Ivan

    Hey,
    Just to let you know it was SELinux related, I did setenforce = 0 and now it is working fine.

    –Ivan.

  • http://enteryoursiteURL... Audinarayana

    Hi,
    I used fedora 14 i configured BackupPC in my office i faced these problem

    tell me solution

    yum install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSS httpd

    rpm -Uvh http://dev.centos.org/centos/5/testing/i386/RPMS/backuppc-3.1.0-1.el5.centos.i386.rpm

    1- Add user backuppc to your machine, User backuppc will be created upon installation. Change apache user to backuppc.

    vi /etc/httpd/conf/httpd.conf

    Change ‘User apache’ to ‘User backuppc

    Save

    2- Edit file /etc/httpd/conf.d/backuppc.conf

    # vi /etc/httpd/conf.d/backuppc.conf

    change ‘Allow from 127.0.0.1′ to ‘Allow from all’

    Save

    3- Create password for cgi-bin admin user

    # htpasswd -c /var/lib/backuppc/passwd/htpasswd admin

    4- Edit backuppc config file

    # vi /etc/BackupPC/config.pl

    Find and change accordingly

    $Conf{ServerHost} = ‘localhost’;

    $Conf{SplitPath} = ‘/usr/bin/split’;

    $Conf{CatPath} = ‘/bin/cat’;

    $Conf{GzipPath} = ‘/bin/gzip’;

    $Conf{Bzip2Path} = ‘/usr/bin/bzip2′;

    $Conf{BackupPCUser} = ‘backuppc’;

    $Conf{TopDir} = ‘/var/lib/backuppc’;

    $Conf{ConfDir} = ‘/etc/BackupPC’;

    $Conf{LogDir} = ‘/var/log/BackupPC’;

    $Conf{InstallDir} = ‘/usr’;

    $Conf{CgiDir} = ‘/usr/share/backuppc/cgi-bin’;

    $Conf{ServerInitdPath} = ‘/etc/init.d/backuppc’;

    $Conf{ServerInitdStartCmd} = ‘$sshPath -q -x -l root $serverHost$serverInitdPath start’;

    $Conf{SshPath} = ‘/usr/bin/ssh’;

    $Conf{NmbLookupPath} = ‘/usr/bin/nmblookup’;

    $Conf{PingPath} = ‘/bin/ping’;

    $Conf{CgiAdminUsers} = ‘admin’;

    Save

    5- Grant passwordless sudo for user backuppc to run /bin/gtar and /bin/tar

    # visudo

    Add these entries :

    Defaults !lecture # to disable lecture

    backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

    Comment this entry

    #Defaults requiretty

    Save and exit

    Restart apache and backuppc service

    # /etc/init.d/http restart

    # /etc/init.d/backuppc restart

    and then open web browser type my server ip and given password.But it is not open
    how to solve my problem

  • http://enteryoursiteURL... Audinarayana

    [quote=Audinarayana]Hi,
    I used fedora 14 i configured BackupPC in my office i faced these problem

    tell me solution

    yum install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSS httpd

    rpm -Uvh http://dev.centos.org/centos/5/testing/i386/RPMS/backuppc-3.1.0-1.el5.centos.i386.rpm

    1- Add user backuppc to your machine, User backuppc will be created upon installation. Change apache user to backuppc.

    vi /etc/httpd/conf/httpd.conf

    Change ‘User apache’ to ‘User backuppc

    Save

    2- Edit file /etc/httpd/conf.d/backuppc.conf

    # vi /etc/httpd/conf.d/backuppc.conf

    change ‘Allow from 127.0.0.1′ to ‘Allow from all’

    Save

    3- Create password for cgi-bin admin user

    # htpasswd -c /var/lib/backuppc/passwd/htpasswd admin

    4- Edit backuppc config file

    # vi /etc/BackupPC/config.pl

    Find and change accordingly

    $Conf{ServerHost} = ‘localhost’;

    $Conf{SplitPath} = ‘/usr/bin/split’;

    $Conf{CatPath} = ‘/bin/cat’;

    $Conf{GzipPath} = ‘/bin/gzip’;

    $Conf{Bzip2Path} = ‘/usr/bin/bzip2′;

    $Conf{BackupPCUser} = ‘backuppc’;

    $Conf{TopDir} = ‘/var/lib/backuppc’;

    $Conf{ConfDir} = ‘/etc/BackupPC’;

    $Conf{LogDir} = ‘/var/log/BackupPC’;

    $Conf{InstallDir} = ‘/usr’;

    $Conf{CgiDir} = ‘/usr/share/backuppc/cgi-bin’;

    $Conf{ServerInitdPath} = ‘/etc/init.d/backuppc’;

    $Conf{ServerInitdStartCmd} = ‘$sshPath -q -x -l root $serverHost$serverInitdPath start’;

    $Conf{SshPath} = ‘/usr/bin/ssh’;

    $Conf{NmbLookupPath} = ‘/usr/bin/nmblookup’;

    $Conf{PingPath} = ‘/bin/ping’;

    $Conf{CgiAdminUsers} = ‘admin’;

    Save

    5- Grant passwordless sudo for user backuppc to run /bin/gtar and /bin/tar

    # visudo

    Add these entries :

    Defaults !lecture # to disable lecture

    backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

    Comment this entry

    #Defaults requiretty

    Save and exit

    Restart apache and backuppc service

    # /etc/init.d/http restart

    # /etc/init.d/backuppc restart

    and then open web browser type my server ip and given password.But it is not open
    how to solve my problem[/quote]

    This is very urgent any one help me
    Thanks
    Audi

  • Brian

    I keep getting the following when running:
    ssh-copy-id -i .ssh/id_rsa.pub backupuser@client

    /usr/bin/ssh-copy-id: ERROR: No identities found

    When setting my ssh client.

    When I:
    ssh backupuser@client

    I am still prompted for a password

  • Jihackn

    hello,
    Thanks for the guide.
    I am trying to create a localhost backup and keep getting connect errors on the backup job. I added a new host called “localhost” using the web interface and am using the rsync option for the backup. I was wondering how I would set up passwordless ssh for the localhost? I followed this using backuppc@localhost but I still keep getting prompted for a password when connecting, and I think that is why my jobs are failing. Any help would be greatly appreciated.

  • Linuxnewbee

    Hi,
    Is this possible to install BackupPC in a Cent OS 6.2 distro and backup other Cent OS servers in my network.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Ladi Oyekanmi

|

Could you please assist in step by step on how to install nagios on solaris

Adhraa

|

Greate tutorial :)

pigmej

|

Just one thing:

What about pep8 in your python code ? How can you give ‘tutorials’ on quite popular website, of such a bad quality ?

Amit Rai

|

I just renamed shared.xml and it logged in and created a new shared.xml.

DB Griffin

|

Larry Page is not being completely honest! The manner in which the PRISM program/project works does not need access from company administrators or owners, so called “direct access”; the access to the information is already there. These tech company CEOs take for granted the actual intelligence of most end users of their products. All it takes is a little digging and reading to go from ignorant to informed on these things especially on exactly how the internet works/functions in the U.S.A. I find Larry Page’s remarks just as laughable as Al Gore’s claim to “inventing” the internet/world wide web!

If you, as an end user, are reading this post; I challenge you to research these matters yourself. It really is quite simple with all the “information sites” that exist on the web today ie Wikipedia, & other online encyclopedias that actually list source material, as well as highly respected tech sites and blogs that also list their source material. Be warned: this is only the tip of the iceberg and these tech CEOs know and understand this; they are scrambling in attempt to perform DAMAGE CONTROL to save the company and what little trust thay have left from their products end users/consumers.

Am I a skeptic? I believe someone has to be or needs to be at this point in time! If your not just a little skeptical of the government, tech companies, and the people that are in charge of these agencies and companies; you need to be, even if just a little skeptic. For your own personal protection and security! I know I was a part of this community for over 14 years!

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .