Tutorial für Suse 10.2
Hier das Tutorial:
1. Vorraussetzungen treffen:
- Compiler und make installieren
- Apache über Yast2 mit mod_perl installieren
- Ist perl installiert ? Überprüfen mit perl -V
- Tar Version soll über 1.13.7 seien ! Überprüfen mit tar --version
- Rsync Version soll über 2.6.3 seien ! Überprüfen mit rsync --version
- Die Perl Module:
Bei meiner Plain Installation war Compress::Zlib installiert (kann per perldoc Compress::Zlib) überprüft werden folgendes musste nachinstalliert werden:
Archive::Zip (
CPAN/modules)
Code:
tar zxvf Archive-Zip-1.16.tar.gz
cd Archive-Zip-1.16
perl Makefile.PL
make
make test
make install
File::RsyncP (
CPAN/modules)
Code:
tar xzvf File-RsyncP-0.68.tar.gz
cd Archive-Zip-1.16
perl Makefile.PL
make
make test
make install
XML:RSS (
CPAN/modules)
Hier fehlten einige Requirements die bequem per Cpan Panel installiert werden können:
Auf der Bash mittels "cpan" panel starten und die Konfiguration mit Default Werten durchführen.
wenn alles Fertig ist mit:
Code:
install Test::Manifest
install DateTime
install HTML::Entities
install DateTime::Format::Mail
install DateTime::Format::W3CDTF
Step für Step abarbeiten, bitte die Dependencies mitinstallieren!
dannach mittels "exit" die cpan Konsole schließen
Code:
tar xzvf XML-RSS-1.31.tar.gz
cd Archive-Zip-1.16
perl Makefile.PL
make
make test : All tests successful, 4 tests skipped.
make install
WICHTIG: SMB lasse ich hier aus da ich keine Windows Server sichern möchte, dazu bitte die Requirements den Dokus entnehmen (SMBClient nmblookup)
2. Backuppc installieren:
Zuvor 1 User namens backuppc anlegen und eine Gruppe backuppc die den User des Webservers (bei Suse wwwrun) sowie den User backuppc enthält.
Entpacken, Makefile erstellen:
Code:
tar xzvf BackupPC-3.1.0.tar.gz
cd BackupPC-3.1.0/
linux-vg69:/tmp/BackupPC-3.1.0 # perl configure.pl
Hier meine Configure Parameter:
Code:
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/tar
gzip => /usr/bin/gzip
hostname => /bin/hostname
nmblookup =>
par2 =>
perl => /usr/bin/perl
ping => /bin/ping
rsync => /usr/bin/rsync
sendmail => /usr/sbin/sendmail
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 [linux-vg69]?
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) []? /srv/www/cgi-bin/
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) []? /srv/www/htdocs
--> URL for image directory (omit http://host; starts with '/') [http://linux-vg69/]? http://10.197.147.51/
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]?
Kopieren des init.d Scripts für backuppc:
Code:
linux-vg69:/tmp/BackupPC-3.1.0 # cd init.d/
linux-vg69:/tmp/BackupPC-3.1.0/init.d # chmod +x suse-backuppc
linux-vg69:/tmp/BackupPC-3.1.0/init.d # cp suse-backuppc /etc/init.d/backuppc
Webserver Konfiguration:
Hier wirds tricky, es gibt 2 Möglichkeiten:
1. Einfach: Den Webserver unter dem User backuppc laufen lassen, was den Nachteil hatt, dass bei anderen Anwendungen möglicherweise Fehler verursachen kann.
2. Arbeiten mit Suexec: Dazu habe ich (basierend auf den Paramtern aus der Backuppc Installation) folgenden Vhost in meine httpd.conf eingefügt:
Code:
<VirtualHost 10.197.147.51>
DirectoryIndex index.html index.htm
ServerName 10.197.147.51
[COLOR="Red"]SuexecUserGroup backuppc backuppc[/COLOR]
DocumentRoot /srv/www/htdocs
ScriptAlias /cgi-bin /srv/www/cgi-bin
<Directory /srv/www/cgi-bin>
Allow from all
</Directory>
</VirtualHost>
(Eventuell noch .htaccess hinzufügen)
Rechte überprüfen der Backuppc Ordner bzw setzen der richtigen Rechte:
Code:
chown backuppc.backuppc /data /usr/local/BackupPC /etc/BackupPC –R
Nun sollte der Start klappen:
Code:
linux-vg69:/ # /etc/init.d/backuppc start
Starting backuppc: ok.
- Einrichten des CGI Webinterfaces (im Bezug auf Methode 2 per SuExec):
Code:
linux-vg69:/tmp/BackupPC-3.1.0/init.d # chown backuppc.backuppc /srv/www/cgi-bin
linux-vg69:/tmp/BackupPC-3.1.0/init.d # cd /srv/www/cgi-bin/
linux-vg69:/srv/www/cgi-bin # dir
total 4
-r-sr-xr-- 1 backuppc users 3993 Nov 29 10:59 BackupPC_Admin
linux-vg69:/srv/www/cgi-bin # chmod -s BackupPC_Admin
linux-vg69:/srv/www/cgi-bin # chown backuppc.backuppc BackupPC_Admin
Das setuid-Bit muss hier entfernt werden, da sonst suexec Meckert.
3. Debuging:
Ich hatte bei 2 Installationen das Problem, dass das CGI Script beim erzeugen fehlerhaft war.
Dazu bitte überprüfen ob in der erste Zeile im BackupPC_Admin der Pfad zu perl stimmt:
Wäre für Suse richtig
Ein paar Zeilen weiter unten noch das "use lib" Dir überprüfen:
Code:
use lib "/usr/local/BackupPC/lib";