Welcome, Guest! Log In | Create Account

FAQ installation

From backuppc

Jump to: navigation, search

Contents

Basic Installation instructions for various distributions.



Note: this page needs to be cleaned up. Forget about installing a package (for any platform) and then upgrading with the tar installer. There is simply no advantage (compared to a tar installation without first installing the package), and you are guaranteed to mess up your packaging system's state. Either package or tar. Your choice. Just do not mix. You have been warned.

Ubuntu

7.04 feisty fawn

to install backuppc version 2 on ubuntu 7.04 with this command

apt-get update
apt-get install backuppc

and follow on screen prompts

to install backuppc version 3 on ubuntu 7.04 follow these steps
first, uncomment the feisty-backports lines in /etc/apt/sources.list

apt-get update
apt-get install backuppc

Manual Upgrade

To upgrade to v3.1, first install v3.0 by "apt-get install backuppc" (from backports), then download the regular install script from http://backuppc.sourceforge.net/ and run it, it will update you to v3.1 Note: There is some doubt whether this method works. Note even more: There is no doubt that this method will mess up dpkg's state. Do this only if you are absolutely desperately looking for problems. Prefer a manual installation. Prefer using V3.0.

7.10 gutsy gibbon

apt-get update
apt-get install backuppc

Manual Upgrade

To upgrade to v3.1, first install v3.0 by "apt-get install backuppc", then download the regular install script from http://backuppc.sourceforge.net/ and run it, it will update you to v3.1 Note: There is no doubt that this method doesn't "work" for normal definitions. Don't do it, see above.

This didn't go too nicely for me. I get the "Error: Unable to read config.pl or language strings!!" when trying to load the web site. I know it's a permissions thing but so far nothing has helped. I did get it working by changing /etc/backuppc to /etc/BackupPC and changeing the init.d script and the apache conf.d file accordingly but on that machine I did a ton of other things so I'm not sure what worked. Did you get the upgrade to work?

8.04 hardy heron

apt-get update
apt-get install backuppc

Manual Upgrade

to install v3.1, first install v3.0 by "apt-get install backuppc", then download the regular install script from http://backuppc.sourceforge.net/ and run it, it will update you to v3.1 Note: Again - don't do it, see above.

Below is the manual upgrade method which does not work! If someone knows how to do a successfull manual upgrade can you please fill in the blanks!

wget http://downloads.sourceforge.net/backuppc/BackupPC-3.1.0.tar.gz
tar -xvzf BackupPC-3.1.0.tar.gz
cd BackupPC-3.1.0
perl configure.pl
--> Full path to existing main config.pl []?
--> Are these paths correct? [y]?
--> BackupPC will run on host [ubuntu]?
--> BackupPC should run as user [backuppc]?
--> Install directory (full path) [/usr/local/BackupPC]?
--> Data directory (full path) [/data/BackupPC]?
--> Compression level [3]?
--> CGI bin directory (full path) []?
--> Do you want to continue? [y]?

For the default settings hit "Enter" for all of the above questions

Reset Password

 htpasswd /etc/backuppc/htpasswd backuppc

User Name: backuppc
Password :


Debian 4.0 (aka etch)

BackupPC version 2.1.2 included, and can be installed with :

apt-get install backuppc

BackupPC version 3.0.0 is available via backports.
Add this line to /etc/apt/sources.list :

deb http://www.backports.org/debian etch-backports main contrib non-free

Import the GPG key for this repository, and update your repositories :

wget -O - http://backports.org/debian/archive.key | apt-key add -
apt-get update

Now you can install BackupPC from the backports repository by :

apt-get -t etch-backports install backuppc

In both cases, you will probably need these packages:

apt-get install rsync bzip2 par2 libfile-rsync-perl libfile-rsyncp-perl/etch-backports ntpdate

After installing, you will have the configuration file at /etc/backuppc and your data directory will be /var/lib/backuppc.


Fedora

google search for "backuppc fedora $version rpm" or go to http://rpm.pbone.net/
Fedora 7 rpm Backuppc 3
Fedora 7 rpm Backuppc 2
RPMs are available for all versions of Fedora and Fedora Core.

rpm -ivh backuppc.rpm

you may also try yum

yum update
yum install backuppc

Red Hat Enterprice Linux

All versions of RHEL seem to require a manual install. click here

RHEL5/Centos5 (tested for version 5. May work for 4)
Install dependencies:

cd /tmp
wget -c -t0 http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
yum -y install httpd mod_ssl perl-Archive-Zip perl-suidperl perl-XML-RSS perl-Time-modules perl-File-RsyncP samba-client

Option 1: -Install source code

Obtain a copy of BackupPC-3.0.0-3.fc8.src.rpm
Or use a later one by google search for "backuppc fedora $version rpm" or go to http://rpm.pbone.net/

Install it:

rpm -ivh BackupPC-3.0.0-3.fc8.src.rpm

Edit the spec file (/usr/src/redhat/SPECS/BackupPC.spec) - replace:

%if %{?fedora}%{?rhel} >= 5
%define useselinux 1
%else
%define useselinux 0
%endif

with

%define useselinux 0

Build the RPM

rpmbuild -ba /usr/src/redhat/SPECS/BackupPC.spec

Install the RPM

rpm -ivh /usr/src/redhat/RPMS/noarch/BackupPC-3.0.0-3.noarch.rpm

Option 2: -Install from pre-compiled binary:

Goto http://rpm.pbone.net/index.php3 and search for "BackupPC". Then download the RPM i.e. with

wget ftp://ftp.uni-bayreuth.de/pub/redhat.com/fedora/linux/releases/9/Everything/ppc/os/Packages/BackupPC-3.1.0-2.fc9.noarch.rpm

Install the RPM now:

rpm -ihv BackupPC-3.1.0-2.fc9.noarch.rpm

Create a password file to protect the web interface

htpasswd -c /etc/BackupPC/apache.users admin

Edit the /etc/httpd/conf.d/BackupPC.conf to match you needs as it is by default configured only for localhost:

deny from all
allow from 127.0.0.1

and change it i.e. to:

allow from all

Configure to start web server and backuppc on boot:

chkconfig httpd on
chkconfig backuppc on

Then point your browser to http://your.host.address.ip/BackupPC


CentOS

Same as RHEL, please see the RHEL section for manual install.


Mandrake/Mandriva

Please follow the Fedora suggestions. rpm.pbone.net has Mandriva RPMs


Nexenta Elate aka opensolaris Ubuntu

as far as Backuppc is concerned, this is Ubuntu 7.04
(edit) though this is essentially ubuntu 7.04 for backuppc, it has File::RsyncP version 0.52 which needs updated before installing Backuppc. Backuppc needs 0.68. Also, Backuppc is not in the repository BUT you can just go to archive.ubuntu.com, browse through the pool, into main, and download the most recent version of backuppc deb. alternatively, you can build a new package on nexenta from source BUT you will not be able to do so OR install backuppc 3+ until you update File::RsyncP


Solaris/openSolaris

Manual install on Solaris (running onSunOS 5.10 Generic_138889-05
i86pc i386 i86pc). Credit for all this hard work goes to Garith
Dugmore - THE Solaris Man.

  • Installation dependencies
 pkg-get -i samba_client par2cmdline apache2 apache2_manual
ap2_modphp5 ap2_modperl perl perldoc gcc4g++\
 pm_termreadkey pm_compressrawzlib pm_compresszlib pm_iocompresszlib
pm_iozlib rsync vim top sudo
 pkg install SUNWhea #Only on OpenSolaris
  • Fix bug in IO:Compress:Zlib
 cd /tmp/
 wget http://search.cpan.org/CPAN/authors/id/P/PM/PMQS/IO-Compress-Zlib-2.015.tar.gz
 gzip -d IO-Compress-Zlib-2.015.tar.gz
 tar xf IO-Compress-Zlib-2.015.tar
 cd IO-Compress-Zlib-2.015
 CC=gcc /opt/csw/bin/perl Makefile.PL
 make
 make install
  • Setup Sun Studio so we can use "cc" to compile.
 cd /tmp/
 wget StudioExpress-sol-x86-2008-11-v2-ii.sh (you will need to
register to get a url for this but it is free)
 mkdir /opt/studio
 cd /opt/studio
 sh /tmp/StudioExpress-sol-x86-2008-11-v2-ii.sh --accept-sla
 ln -s /opt/studio/SUNWspro/bin/cc /usr/bin/
  • Adding perl modules
cpan
  • Hit enter through all options and choose ftp.is.co.za as a mirror.

Once you at the cpan prompt:

 install File::RsyncP
  • Install BackupPC
 mkdir /tmp/backuppc
 cd /tmp/backuppc
 wget http://url/BackupPC-3.1.0.tar.gz (insert working URL here)
 gzip -d BackupPC-3.1.0.tar.gz
 tar xf BackupPC-3.1.0.tar
 cd BackupPC-3.1.0
  • For the next step hit enter for the defaults except for:
 /opt/csw/bin/perl configure.pl

1. --> BackupPC should run as user [backuppc]? nobody
2. --> Data directory (full path) [/data/BackupPC]? /data
3. --> CGI bin directory (full path) []? /opt/csw/apache2/share/cgi-bin/
4. --> Apache image directory (full path) []?
/opt/csw/apache2/share/htdocs/image
5. --> URL for image directory (omit http://host; starts with '/')
[]? /image

  • Configure BackupPC startup script
 cd /etc/init.d/ ; touch backuppc

Insert the following into the backuppc file you just created:

#!/usr/bin/sh
#
# DESCRIPTION
#
#   Startup init script for BackupPC for solaris.
#
# Distributed with BackupPC version 3.1.0, released 25 Nov 2007.
#
# Not tested...
#

case "$1" in
  start)
       #
        # You can set the SMB share password here is you wish.  Otherwise
        # you should put it in the config.pl script.
    # If you put it here make sure this file has no read permissions
        # for normal users!  See the documentation for more information.
      #
       #BPC_SMB_PASSWD=
       #export BPC_SMB_PASSWD
       #
        su nobody -c "/usr/local/BackupPC/bin/BackupPC -d"
    ;;
  stop)
    /usr/bin/pkill -f "/usr/bin/perl /usr/local/BackupPC/bin/BackupPC -d"
    ;;
  restart)
    /usr/bin/pkill -f "/usr/bin/perl /usr/local/BackupPC/bin/BackupPC -d"
    su nobody -c "/usr/local/BackupPC/bin/BackupPC -d"
    ;;
  reload)
        /usr/bin/pkill -1 -f "/usr/local/BackupPC/bin/BackupPC -d"
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|reload}"
    exit 1
esac

exit $?
 chmod 777 backuppc
 cd /etc/rc0.d
 ln -s ../init.d/backuppc K40backuppc
 cd /etc/rc2.d
 ln -s ../init.d/backuppc S99backuppc
 usermod -s /usr/bin/bash nobody
 /etc/init.d/backuppc restart
 chmod u+x /var/log/BackupPC/status.pl
 cd /opt/csw/apache2/share/cgi-bin/
 ln -s BackupPC_Admin index.cgi
  • Setup up /opt/csw/etc/sudoers ; append:
 nobody  ALL=NOPASSWD: /usr/sfw/bin//gtar
 nobody  ALL=NOPASSWD: /usr/bin/env
 nobody  ALL=NOPASSWD: /usr/bin/ssh
 nobody  ALL=NOPASSWD: /opt/csw/bin/rsync

Note: This is stupid advice (and that is giving the original author the benefit of the doubt). User "nobody" really shouldn't have passwordless root access to any command. Let's take apart all four lines in detail: 1. 'gtar' lets user nobody overwrite /etc/passwd or /etc/shadow (or whatever) or simply install an arbitrary setuid-root binary anywhere on the system. 2. 'env' gives direct execute access to any command. 3. if 'ssh' needed to be run as root, it would be installed setuid-root, wouldn't it? 4. 'rsync' - same problems as 'gtar'.
While BackupPC will need at least read access to all files it is to backup (and write access if you want automatic restores through the web interface), the 'nobody' user doesn't. You shouldn't use user 'nobody' for running BackupPC - that's just plain stupid. If you think otherwise, you need to explain your reasons in detail.
Never blindly trust anything you find in a public wiki. Never put advice you don't fully understand in a public wiki.

  • Put sudo in its normal place:
 ln -s /opt/csw/bin/sudo /usr/bin/

Configure Apache2 (you may need to install apache)

  • Append the following to /opt/csw/apache2/etc/httpd.conf
  • NOTE that the ssl keys line in the httpd.conf will differ between

machines. If apache2 doesn't start (check using - ps -fel | grep
httpd) then try running /opt/csw/apache2/sbin/httpd to see what the
problem is. Also note we are using LDAP auth - choose your auth method
and modify accordingly

 Alias /BackupPC/ /opt/csw/apache2/share/cgi-bin/
 <Directory /opt/csw/apache2/share/cgi-bin>
       RewriteEngine on
       RewriteCond %{SERVER_PORT} =80
       RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
       AllowOverride None
       Options ExecCGI FollowSymlinks
       Order Allow,Deny
       Allow from all
       AddHandler cgi-script .cgi
       DirectoryIndex index.cgi
       AuthType basic
       AuthBasicProvider ldap
       AuthBasicAuthoritative On
       AuthLDAPURL ldap://<Your.LDAP>/ou=people,dc=<yourDC>?uid
       AuthName "BackupPC admin"
       require valid-user
 </Directory>
 LoadModule ssl_module libexec/mod_ssl.so
 Listen 443
 NameVirtualHost *:443
 <VirtualHost *:443>
       ServerAdmin root@<SERVERNAME>
       SSLEngine on
       SSLCertificateFile /opt/csw/apache2/etc/apache.pem
 <Directory "/opt/csw/apache2/share/cgi-bin">
       SSLOptions +StdEnvVars
 </Directory>
 </VirtualHost>
  • Enable and start Apache:
 svcadm enable svc:/network/http:cswapache2
 svcadm refresh svc:/network/http:cswapache2