'''BackupPC''' is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

'''BackupPC''' is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.

Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.

−

==Installation==

+

== Installation ==

−

BackupPC is part of the official repos. You can simply install it with pacman:

+

[[pacman|Install]] {{Pkg|backuppc}} from the [[official repositories]].

−

# pacman -S backuppc

+

Install {{Pkg|rsync}} and {{Pkg|perl-file-rsyncp}} if you want to use [[rsync]] as a transport.

−

=== Additional Packages ===

+

=== Start BackupPC ===

−

The following packages are available if you want to

−

* Use rsync as a transport: rsync & perl-file-rsyncp

−

* Use compression: perl-compress-zlib

+

Start '''backuppc''' [[systemd]] [[daemon]] and, if you wish to have running at boot time enable it.

−

===Start BackupPC===

+

== Apache Configuration ==

−

To manually start BackupPC issue this command.

−

# /etc/rc.d/backuppc start

−

===Make BackupPC run at startup===

+

BackupPC has a web interface that allows you to easily control it. You can access it using Apache and mod_perl but other webservers like {{Pkg|lighttpd}} works too.

−

To make BackupPC load at startup edit /etc/rc.conf and add it to DAEMONS.

+

Install {{Pkg|apache}} and {{Pkg|mod_perl}} from the official repositories.

−

# nano -w /etc/rc.conf

−

DAEMONS=(... backuppc ...)

−

==Apache Configuration==

+

=== Edit Apache configuration ===

−

BackupPC has a web interface that allows you to easily control it. It requires Apache and mod_perl.

−

−

===Install Apache and mod_perl===

−

# pacman -S apache mod_perl

−

−

===Edit Apache configuration===

−

Edit the Apache configuration file...

−

# nano -w /etc/httpd/conf/httpd.conf

−

−

...to load mod_perl, tell Apache to run as user backuppc and to include /etc/httpd/conf/extra/backuppc.conf

+

Edit the Apache configuration file to load mod_perl, tell Apache to run as user backuppc and to include {{ic|/etc/httpd/conf/extra/backuppc.conf}}:

+

{{hc|/etc/httpd/conf/httpd.conf|

LoadModule perl_module modules/mod_perl.so

LoadModule perl_module modules/mod_perl.so

User backuppc

User backuppc

+

Group backuppc

Include conf/extra/backuppc.conf

Include conf/extra/backuppc.conf

+

}}

−

Edit /etc/BackupPC/config.pl. Set administrator name

+

Edit {{ic|/etc/backuppc/config.pl}}. Set administrator name:

$Conf{CgiAdminUsers} = 'admin';

$Conf{CgiAdminUsers} = 'admin';

−

Next, we neet to add a users file and set the admin password:

+

Next, we need to add a users file and set the admin password:

# htpasswd -c /etc/backuppc/backuppc.users admin

# htpasswd -c /etc/backuppc/backuppc.users admin

−

{{Note|The BackupPC-Webfrontend is initially configured, that you can only access it from the localhost. If you want to access it from all machines in your network, you have to edit /etc/httpd/conf/backuppc.conf:}}

+

The BackupPC-Webfrontend is initially configured, that you can only access it from the localhost. If you want to access it from all machines in your network, you have to edit {{ic|/etc/httpd/conf/extra/backuppc.conf}}.

−

# nano -w /etc/httpd/conf/backuppc.conf

Edit the line

Edit the line

allow from 127.0.0.1

allow from 127.0.0.1

Line 52:

Line 39:

allow from 127.0.0.1 192.168.0

allow from 127.0.0.1 192.168.0

where you have to replace 192.168.0 to your corresponding IP-Adresses you want to gain access from.

where you have to replace 192.168.0 to your corresponding IP-Adresses you want to gain access from.

The current setup of backuppc, the webserver needs to run as backuppc user and this can be a problem on many setups where the webserver is used for other sites. In the past one could suid a perl script, but it was blocked globally due security problems several years ago. To workaround that, perl-suid was used, but again blocked due the same problem more recently, scripts can't be run securely with suid bit. Still there is another way, this time using a simple binary program that is suid as a launcher, that will run the backuppc perl scripts already with the correct user. This isolates the perl script from the enviorment and its considered safe.

+

+

To setup the backuppc to run on this mode you need to replace the original backuppc cgi with the below C code compiled program and move the backuppc cgi to another place.

+

+

Save the C code to a file named wrapper.c (please update the cgi path if needed) and compile it with:

+

+

$ gcc -o BackupPC_Admin wrapper.c

+

+

The wrapper C code:

+

+

#include <unistd.h>

+

#define REAL_PATH "/usr/share/backuppc/lib/real-BackupPC_Admin.cgi"

+

int main(ac, av)

+

char **av;

+

{

+

execv(REAL_PATH, av);

+

return 0;

+

}

+

+

move the real cgi {{ic|/usr/share/backuppc/cgi-bin/BackupPC_Admin}} to the lib directory {{ic|/usr/share/backuppc/lib/real-BackupPC_Admin.cgi}} , place the new binary {{ic|BackupPC_Admin}} in the cgi-bin directory and chown the binary cgi to {{ic|backuppc:http}} and set the suid bit:

−

===Starting BackupPC and Apache manually===

+

chown backuppc:http /usr/share/backuppc/cgi-bin/BackupPC_Admin

−

# /etc/rc.d/backuppc start

+

chmod 4750 /usr/share/backuppc/cgi-bin/BackupPC_Admin.

−

# /etc/rc.d/httpd start

−

===Starting both on boot===

+

keep your web server with its usual user and backup should now be able to run correctly

Revision as of 19:40, 6 September 2013

BackupPC is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.

Installation

Start BackupPC

Start backuppcsystemddaemon and, if you wish to have running at boot time enable it.

Apache Configuration

BackupPC has a web interface that allows you to easily control it. You can access it using Apache and mod_perl but other webservers like lighttpd works too.
Install apache and mod_perl from the official repositories.

Edit Apache configuration

Edit the Apache configuration file to load mod_perl, tell Apache to run as user backuppc and to include /etc/httpd/conf/extra/backuppc.conf:

The BackupPC-Webfrontend is initially configured, that you can only access it from the localhost. If you want to access it from all machines in your network, you have to edit /etc/httpd/conf/extra/backuppc.conf.
Edit the line

allow from 127.0.0.1

to

allow from 127.0.0.1 192.168.0

where you have to replace 192.168.0 to your corresponding IP-Adresses you want to gain access from.
Then just start Apache service.

Accessing the admin page

The webserver user and the suid problem

The current setup of backuppc, the webserver needs to run as backuppc user and this can be a problem on many setups where the webserver is used for other sites. In the past one could suid a perl script, but it was blocked globally due security problems several years ago. To workaround that, perl-suid was used, but again blocked due the same problem more recently, scripts can't be run securely with suid bit. Still there is another way, this time using a simple binary program that is suid as a launcher, that will run the backuppc perl scripts already with the correct user. This isolates the perl script from the enviorment and its considered safe.

To setup the backuppc to run on this mode you need to replace the original backuppc cgi with the below C code compiled program and move the backuppc cgi to another place.

Save the C code to a file named wrapper.c (please update the cgi path if needed) and compile it with:

move the real cgi /usr/share/backuppc/cgi-bin/BackupPC_Admin to the lib directory /usr/share/backuppc/lib/real-BackupPC_Admin.cgi , place the new binary BackupPC_Admin in the cgi-bin directory and chown the binary cgi to backuppc:http and set the suid bit: