yum install
perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSS
httpd
yum
-y install perl-suidperl mod_perl
rpm -ivh
backuppc_community-3.2.0beta0-1.rhel5.noarch.rpm
1- 上面安装会创建backuppc,apache用户。
vi
/etc/httpd/conf/httpd.conf
修改‘User apache‘ 为 ‘User backuppc
User apache
Group apache
2- 编辑
/etc/httpd/conf.d/backuppc.conf
# vi
/etc/httpd/conf.d/backuppc.conf --允许连接的地址
修改‘Allow from 127.0.0.1‘ 为 ‘Allow
from all‘
#
# DESCRIPTION
#
# This file controls access and
configuration for the BackupPC CGI
# interface.
#
# Distributed with BackupPC version 3.1.1, released 22 Dec
2008.
#
# This section tells apache which machines can access the
interface.
# You can change the allow line to allow access from your
local
# network, or comment out this region to allow access from
all
# machines.
#
order allow,deny
#deny from all
allow from all
#
# You can change the authorization method to LDAP or another
method
# besides htaccess here if you are so inclined. Comment out the lines
# below or create an htpasswd file called BackupPC.users in the
same
# directory as this file.
#
AuthType Basic
AuthUserFile /etc/httpd/conf.d/BackupPC.usersAuthName
"BackupPC Community Edition Administrative Interface"
require valid-user
order deny,allow
deny from none
allow from all
Alias /BackupPC/images /usr/lib/backuppc/www/images
ScriptAlias /BackupPC_Admin /usr/lib/backuppc/www/html/BackupPC_Admin
ScriptAlias /backuppc /usr/lib/backuppc/www/html/BackupPC_Admin
3- Create password for cgi-bin backuppc
user
# htpasswd -c /etc/httpd/conf.d/BackupPC.users
backuppc
--生成登陆密码文件。
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} = 'backuppc';
Save
5- Grant passwordless sudo for user backuppc to
run /bin/gtar and /bin/tar
# visudo
--让backup用户,可以执行一些命令
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
重启服务使生效。
# /etc/init.d/http restart
# /etc/init.d/backuppc restart
Open your browser and point it to
'http://IP/backuppc' and you should see the backuppc web
interface