First off let us resolve the dependancies:
yum install httpd expect perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP mod_perl
Create a user for BackupPC and set it's passwd:
useradd backuppc
passwd backuppc
Create the directory where the backups need to go and set it's permissions:
mkdir -p /data/BackupPC/
chmod -R 750 /data/BackupPC/
chown -R backuppc:backuppc /data/BackupPC/
Download and extract the latest version from Sourceforge: BackupPC Sourceforge page
wget http://ovh.dl.sourceforge.net/sourceforge/backuppc/BackupPC-3.1.0.tar.gz
tar zxvf BackupPC-3.1.0.tar.gz
cd BackupPC-3.1.0
Now we run the installer:
perl configure.pl
Is this a new installation or upgrade for BackupPC? If this is
an upgrade please tell me the full path of the existing BackupPC
configuration file (eg: /etc/BackupPC/config.pl). Otherwise, just
hit return.
--> Full path to existing main config.pl []?
I found the following locations for these programs:
bzip2 => /usr/bin/bzip2
cat => /bin/cat
df => /bin/df
gtar/tar => /bin/gtar
gzip => /bin/gzip
hostname => /bin/hostname
nmblookup => /usr/bin/nmblookup
par2 =>
perl => /usr/bin/perl
ping => /bin/ping
rsync => /usr/bin/rsync
sendmail => /usr/sbin/sendmail
smbclient => /usr/bin/smbclient
split => /usr/bin/split
ssh/ssh2 => /usr/bin/ssh
--> Are these paths correct? [y]?
Please tell me the hostname of the machine that BackupPC will run on.
--> BackupPC will run on host [backup.domain.co.za]?
BackupPC should run as a dedicated user with limited privileges. You
need to create a user. This user will need read/write permission on
the main data directory and read/execute permission on the install
directory (these directories will be setup shortly).
The primary group for this user should also be chosen carefully.
The data directories and files will have group read permission,
so group members can access backup files.
--> BackupPC should run as user [backuppc]?
Please specify an install directory for BackupPC. This is where the
BackupPC scripts, library and documentation will be installed.
--> Install directory (full path) [/usr/local/BackupPC]?
Please specify a data directory for BackupPC. This is where all the
PC backup data is stored. This file system needs to be big enough to
accommodate all the PCs you expect to backup (eg: at least several GB
per machine).
--> Data directory (full path) [/data/BackupPC]?
BackupPC can compress pool files, providing around a 40% reduction in pool
size (your mileage may vary). Specify the compression level (0 turns
off compression, and 1 to 9 represent good/fastest to best/slowest).
The recommended values are 0 (off) or 3 (reasonable compression and speed).
Increasing the compression level to 5 will use around 20% more cpu time
and give perhaps 2-3% more compression.
--> Compression level [3]?
BackupPC has a powerful CGI perl interface that runs under Apache.
A single executable needs to be installed in a cgi-bin directory.
This executable needs to run as set-uid backuppc, or
it can be run under mod_perl with Apache running as user backuppc.
Leave this path empty if you don't want to install the CGI interface.
--> CGI bin directory (full path) []? /var/www/cgi-bin/backuppc
BackupPC's CGI script needs to display various GIF images that
should be stored where Apache can serve them. They should be
placed somewhere under Apache's DocumentRoot. BackupPC also
needs to know the URL to access these images. Example:
Apache image directory: /usr/local/apache/htdocs/BackupPC
URL for image directory: /BackupPC
The URL for the image directory should start with a slash.
--> Apache image directory (full path) []? /var/www/html/BackupPC
--> URL for image directory (omit http://host; starts with '/') []? /BackupPC
Ok, we're about to:
- install the binaries, lib and docs in /usr/local/BackupPC,
- create the data directory /data/BackupPC,
- create/update the config.pl file /etc/BackupPC/config.pl,
- optionally install the cgi-bin interface.
--> Do you want to continue? [y]? y
Edit /etc/BackupPC/config.pl and change the fields listed as follows:
$Conf{BlackoutPeriods} = [];
$Conf{XferMethod} = 'rsync';
$Conf{CgiAdminUsers} = 'admin';
Copy the init script and enable BackupPC on bootup:
cp init.d/linux-backuppc /etc/init.d/backuppc
chmod +x /etc/init.d/backuppc
/etc/init.d/backuppc start
chkconfig backuppc on
Create a new configuration file for the web interface vim /etc/httpd/conf.d/backuppc.conf and add the following:
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order deny,allow
Deny from all
Allow from $IP RANGE
AuthName "Backup Admin"
AuthType Basic
AuthUserFile /var/www/cgi-bin/.backuppcpsswd
AllowOverride All
Require valid-user
or....
vi /etc/httpd/conf/httpd.conf
and add the following at the end,
#
user backuppc
group backuppc
ServerName 192.168.0.227
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
Order deny,allow
Deny from all
Allow from $IP RANGE
AllowOverride Indexes AuthConfig
AuthName "Backup Admin"
AuthType Basic
AuthUserFile /var/www/cgi-bin/.backuppcpsswd
Require valid-user
Create the admin user:
htpasswd -c /var/www/cgi-bin/.backuppcpsswd admin
Change the user apache runs as (works with Scalix) otherwise configure a new instance of apache, edit /etc/httpd/conf/httpd.conf
User backuppc
Group backuppc
Restart apache:
service httpd restart
Check for errors
tail -f /var/log/httpd/error_log