24 Haziran 2009 Çarşamba

Openfiler de BackupPC Kurulumu

Gerekli olanlar:
  • Büyük bir disk alanına sahip Linux,Solaris yada Unix tabanli bir sunucu.CPU ve disk performansı bu sunucuda kaçtane backup çalıştırılabileceğini belirler.Orta dereceli yapılandırılmış bir sunucuda 4 ila 8 backup çalıştırılabilir.Veriler disk üzerindeki boş alana kaydedilir.Yeni veriler geldikçe eğer veri zaten kayıtlı ise tekrar tekrar kaydedilmez.
  • Perl 5.8.0 ya da daha güncel sürümü.
  • Perl modülleri : Compress::Zlib, Archive::Zip, File::RsyncP.
  • Tar 1.13.20 ya da daha güncel sürümü.
  • Rsync 2.6.3 ya da daha güncel sürümü.
  • XML-RSS.
  • Apache web server.
  • Mod_perl.
Yukaridaki listedeli paket programlar BackupPC için gerekli olanlar.Ama Openfiler da çoğu paket programlar kurulu olarak gelmediği için yukaridaki listediki programları derlememiz için öncesinde bazı programları da derlememiz gerekecek.

Gerkli paketlerin kurulumu:

Ben çalışmalarımı Ubuntu 9.0.4 te yapıyorum.Openfileri de Virtualbox'a kurdum.Kuruluma geçmeden önce indirdiğimiz bu paketleri nasıl openfiler'e kaydedeceğiz onu görelim.Buınun için ben ubuntu'ya gFTP diye server üzerinden dosya transferi yapan bir yazılım yükledim,daha sonrada openfilerin ip adresini ve root şifresini kullanarak SSH2 bağlantısı kurdum ve dosyalarımı openfiler'e aktardım.Dosyaları /temp/ dizininde kopyaladım ve bundan sonraki tüm kurulumlarımda bu dizini kullanacağım.

Şimdi aşağıdaki listedeki programları sırası ile kuralım.Bu aşamada virtualbox'a root olarak giriş yaptıktan sonra aşağıdaki komutlarla paket programları derledim.

1-Perl. Download.
Bu programı kurmak için sistemimizde GNU compailer olması gerekiyor.Openfiler de bu compailer olmadığı için öncelikle onu kuralım.

conary update gcc
conary update glib:devel
conary update glibc:devel
conary update automake
conary update autoconf
conary update pkgconfig

Daha sonra perl'i şu komutlarla derliyoruz.

cd /temp
tar xzvf perl-x.xx.x.tar.gz
cd perl-x.xx.x
sh Configure -de
make & make test
make install

2-Compress-Raw-Zlib. Download.

cd /temp
tar xzvf Compress-Raw-Zlib-x.xx.x.tar.gz
cd Compress-Raw-Zlib-x.xx.x
perl Makefile.PL
make & make test
make install


3-Archive-Zip. Download.

cd /temp
tar xzvf Archive-Zip-x.xx.x.tar.gz
cd Archive-Zip-x.xx.x
perl Makefile.PL
make & make test
make install


4-File-Rsyncp. Download.

cd /temp
tar xzvf File-Rsyncp-x.xx.x.tar.gz
cd File-Rsyncp-x.xx.x
perl Makefile.PL
make & make test
make install

5-Compress-Raw-Bzip2. Download.

cd /temp
tar xzvf Compress-Raw-Bzlip2-x.xx.x.tar.gz
cd Compress-Raw-Bzlip2-x.xx.x
perl Makefile.PL
make & make test
make install

6-IO-Compress. Download.

cd /temp
tar xzvf Compress-Raw-Zlib-x.xx.x.tar.gz
cd Compress-Raw-Zlib-x.xx.x
perl Makefile.PL
make & make test
make install

7-Tar. Download.

cd /temp
tar xzvf tar-x.xx.x.tar.gz
cd tar-x.xx.x
./configure
make & make check
make install

8-Apache web server(httpd). Download.

cd /temp
tar xzvf httpd-x.xx.x.tar.gz
cd httpd-x.xx.x
./configure
make
make install

Apache web server'i kurduğumuzda test etmek için /etc/init.d/httpd start ya da apachactel start komutlarını deneyebiliriz.

9-Mod_perl. Download.

cd /temp
tar xzvf mod_perl-x.xx.x.tar.gz
cd mod_perl-x.xx.x
perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs
make && make test

Bu komutu verdiğimizde eğer *[ error] failed to start server! (please examine t/log/error_log) böyle bir hata ile karşılaşırsak panik yapmaya gerek yok biz kuruluma aşağıdaki komutla devam edebiliriz.

make install

Kurulum bitince de mod_perl'i apache'bin modül listesine eklemek için şu komutu çalıştıralım:

cp /usr/local/apache2/modules/mod_perl.so /etc/httpd/modules/

10-HTML-Tagset. Download.

cd /temp
tar xzvf HTML-Tagset-x.xx.x.tar.gz
cd HTML-Tagset-x.xx.x
perl Makefile.PL
make & make test
make install

11-HTML-Parser. Download.

cd /temp
tar xzvf HTML-Parser-x.xx.x.tar.gz
cd HTML-Parser-x.xx.x
perl Makefile.PL
make & make test
make install

12-URI. Download.

cd /temp
tar xzvf URI-x.xx.x.tar.gz
cd URI-x.xx.x
perl Makefile.PL
make & make test
make install

13-Lib-www-Perl. Download.

cd /temp
tar xzvf Lib-www-Perl-x.xx.x.tar.gz
cd Lib-www-Perl-5-x.xx.x
perl Makefile.PL
make & make test
make install

14-Expat.Download

cd /temp
tar xzvf expat-x.xx.x.tar.gz
cd expat-x.xx.x
./configure
make
make install

15-XML-Parser. Download.

cd /temp
tar xzvf XML-Parser-x.xx.x.tar.gz
cd XML-Parser-x.xx.x
perl Makefile.PL
make & make test
make install

16-Params-Validate. Download.

cd /temp
tar xzvf Params-Validate-x.xx.x.tar.gz
cd Params-Validate-x.xx.x
perl Makefile.PL
make & make test
make install

17-Class-Singleton. Download.

cd /temp
tar xzvf Class-Singleton-x.xx.x.tar.gz
cd Class-Singleton-x.xx.x
perl Makefile.PL
make & make test
make install

18-DateTime-TimeZone. Download.

cd /temp
tar xzvf DateTime-Zone-x.xx.x.tar.gz
cd DateTime-Zone-x.xx.x
perl Makefile.PL
make & make test
make install

19-List-Moreutils. Download.

cd /temp
tar xzvf list-moreutils-x.xx.x.tar.gz
cd list-moreutils-x.xx.x
perl Makefile.PL
make & make test
make install

20-DateTime-Locale. Download.

cd /temp
tar xzvf DateTime-Locale-x.xx.x.tar.gz
cd DateTime-Locale-x.xx.x
perl Build.PL
./Build
./Build test
./Build install

21-DateTime. Download.

cd /temp
tar xzvf DateTime-x.xx.x.tar.gz
cd DateTime-x.xx.x
perl Makefile.PL
make & make test
make install

22-DateTime-Format-Mail. Download.

cd /temp
tar xzvf DateTime-Format-Mail-x.xx.x.tar.gz
cd DateTime-Format-Mail-x.xx.x
perl Build.PL
./Build test
./Build install

23-DateTime-Format-W3CDTF. Download.

cd /temp
tar xzvf DateTime-Format-W3CDTF-x.xx.x.tar.gz
cd DateTime-Format-W3CDTF-x.xx.x
perl Makefile.PL
make & make test
make install

24-Test-ManiFest. Download.

cd /temp
tar xzvf Test-ManiFest-x.xx.x.tar.gz
cd Test-ManiFest-x.xx.x
perl Makefile.PL
make & make test
make install

25-XML-RSS. Download.

cd /temp
tar xzvf XML-RSS-x.xx.x.tar.gz
cd XML-RSS-x.xx.x
perl Makefile.PL
make & make test
make install



Paket programları kurduktan sonra BackupPC'nin kurulumuna geçmeden önce güvenlik için onu kullanacak bi kullanıcı eklememiz gerekiyor.Önce bir gurup ekleyeceğiz ve daha sonra o guruba kullanıcı ekleyeceğiz.Bu işlemeri gerçekleştirmek için root olarak şu komutları kullanıyoruz:

groupadd backuppc
useradd -g backuppc backuppc

Şimdide eklediğimiz kulanıcının şifresini belirleyeceğiz.

passwd backuppc

Artık sistemimiz BackupPC programını derlemeye hazır.

Kurulum:

Öncelikle BackupPc nin son sürümünü indirioruz: BackupPC
Dosyamızı yine /temp/ dizinine kopyaladıktan sonraaşağıdaki komularla programı kuruyoruz:

cd /temp
tar xzvf BackupPC-x.xx.x.tar.gz
cd
BackupPC-x.xx.x
perl configure.pl

Bu kısımda program bize bir çok soru soracak,bu sorularıda aşağıdaki gibi cevaplıyoruz.

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 []? Enter 'a basarak devam edin



I found the following locations for these programs:


bzip2 =>

cat => /bin/cat

df => /bin/df

gtar/tar => /usr/bin/tar

gzip => /usr/bin/gzip

hostname => /bin/hostname

nmblookup => /usr/local/bin/nmblookup

par2 =>

perl => /usr/bin/perl

ping => /sbin/ping

rsync => /usr/local/bin/rsync

sendmail =>

smbclient => /usr/local/bin/smbclient

split =>

ssh/ssh2 => /usr/bin/ssh


--> Are these paths correct? [y]? y


Please tell me the hostname of the machine that BackupPC will run on.


--> BackupPC will run on host [freenas.harrys.homelinux.net]? localhost


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]? 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]? Enter 'a basarak devam edin


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]? Enter 'a basarak devam edin


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]? Enter 'a basarak devam edin


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 root, or

it can be run under mod_perl with Apache running as user root.


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/images

--> 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 /mnt/datapool/backuppc,

- create/update the config.pl file /etc/BackupPC/config.pl,

- optionally install the cgi-bin interface.


--> Do you want to continue? [y]? y

Created /usr/local/BackupPC/bin

Created /usr/local/BackupPC/doc

Created /usr/local/BackupPC/lib/BackupPC/CGI

Created /usr/local/BackupPC/lib/BackupPC/Config

Created /usr/local/BackupPC/lib/BackupPC/Lang

Created /usr/local/BackupPC/lib/BackupPC/Storage

Created /usr/local/BackupPC/lib/BackupPC/Xfer

Created /usr/local/BackupPC/lib/BackupPC/Zip

Created /usr/local/www/images

Created /mnt/datapool/backuppc

Created /mnt/datapool/backuppc/pool

Created /mnt/datapool/backuppc/cpool

Created /mnt/datapool/backuppc/pc

Created /mnt/datapool/backuppc/trash

Created /etc/BackupPC

Created /var/log/BackupPC

Installing binaries in /usr/local/BackupPC/bin

Installing library in /usr/local/BackupPC/lib

Installing images in /usr/local/www/images

Making init.d scripts

Installing docs in /usr/local/BackupPC/doc

Installing config.pl and hosts in /etc/BackupPC

Installing cgi script BackupPC_Admin in /usr/local/www


Ok, it looks like we are finished. There are several more things you

will need to do:


- Browse through the config file, /etc/BackupPC/config.pl,

and make sure all the settings are correct. In particular,

you will need to set $Conf{CgiAdminUsers} so you have

administration privileges in the CGI interface.


- Edit the list of hosts to backup in /etc/BackupPC/hosts.


- Read the documentation in /usr/local/BackupPC/doc/BackupPC.html.

Please pay special attention to the security section.


- Verify that the CGI script BackupPC_Admin runs correctly. You might

need to change the permissions or group ownership of BackupPC_Admin.

If this is an upgrade and you are using mod_perl, you will need

to restart Apache. Otherwise it will have stale code.


- BackupPC should be ready to start. Don't forget to run it

as user root! The installation also contains an

init.d/backuppc script that can be copied to /etc/init.d

so that BackupPC can auto-start on boot. This will also enable

administrative users to start the server from the CGI interface.

See init.d/README.


Enjoy!


BackupPC yazılımını Openfiler üzerine kurduk.Şimdi de BackupPC yi /etc/init.d/ dizibininden başlatabilmek için şu işlemleri yapalım:

cp /tmp/
BackupPC-x.xx.x/init.d/linux-backuppc /etc/init.d/backuppc
chmod +x /etc/init.d/backuppc
chkconfig --add backuppc
chkconfig --level 345 backuppc on
chown -R backuppc:backuppc /etc/init.d/backuppc

Bu aşamada BackupPC yi çalıştırmak için bulunduğu dizinde bir hardlink oluşturmamız gerekiyor.Bu işlemi şöyle yapıyoruz:

chown -R backuppc:backuppc /data/
su - backuppc
cd /data
mkdir yedekBackupPC
cd yedekBackupPC
mkdir pc
cd pc/
/usr/local/BackupPC/bin/BackupPC_tarPCCopy /data/BackupPC/pc

Programın çalışıp çalışmadığını test etmek için de daha önce oluşturduğumuz backuppc kullanıcı ile sisteme giriş yapıp şu komutları çalıştıralım:

su - backuppc
/etc/init.d/bckuppc start

Kurulum burda tamamlanıyor.BackupPC nin web arayüzünü çalıştırmak için bazı ayarlar yapmamız gerekiyor.Bu ayarları yapabilmek için Openfiler da BackupPC & Apache Ayarları yazı dizisini okuyabilirsiniz.

Hiç yorum yok:

Yorum Gönder