Installation Of Bacula Server and Bacula-Client on Remote Host (Using YUM)
Using SOURCE

0. Update local packages cache from repositories and install updates

apt-get update
apt-get upgrade

1. Install required packages
mysql-server mysql-client build-essential libmysqld-dev libmysqlclient-dev libncurses5-dev libncursesw5-dev postfix

2. Configure the MySql Database

mysql -u root -p
create database bacula;
grant all on bacula.* to ‘bacula’@’localhost’ identified by ‘b@cUl@’;
flush privileges;
quit

3. Goto /usr/src/ direcotry and download Bacula source files. http://sourceforge.net/projects/bacula/

cd /usr/src
wget http://nchc.dl.sourceforge.net/project/bacula/bacula/5.2.6/bacula-5.2.6.tar.gz

4. Extract Bacula
tar -zxf bacula-5.2.6.tar.gz
cd bacula-5.2.6

5. Run the Bacula configure script

CFLAGS=”-g -O2 -Wall”  ./configure –sbindir=/usr/local/bacula –sysconfdir=/usr/local/bacula –with-pid-dir=/usr/local/bacula/working –with-subsys-dir=/usr/local/bacula/working –enable-smartalloc –with-mysql –with-working-dir=/usr/local/bacula/working –with-dump-email=”farhan.umer@nxvt.com” –with-job-email=”farhan.umer@nxvt.com” –with-smtp-host=localhost –with-dir-password=b@cUl@ –with-fd-password=b@cUl@ –with-sd-password=b@cUl@ –with-db-name=bacula –with-db-user=bacula

If after running ./configure once, you decide to change options and re-run it, before re-running it, you should run:
make distclean

6. Compile the Bacula source code, Install binaries
make
make install

7. Create Start up scripts

make install-autostart

8. Bacula installation includes script that will generate bacula mysql tables for you

cd /usr/local/bacula
./make_mysql_tables -u bacula -p
Enter pass selected for bacula mysql user:

9. Bacula is now completed installed, last step make sure mysql credential are collect in bacula director configulation file /usr/local/bacula/bacula-dir.conf

vi /usr/local/bacula/bacula-dir.conf

Catalog {
Name = MyCatalog
dbname = “bacula”; dbuser = “bacula”; dbpassword = “b@cUl@”
}

10. Start the services
/etc/init.d/bacula-sd start
/etc/init.d/bacula-fd start
/etc/init.d/bacula-dir start

To Restart bacula
cd /usr/local/bacula/
./bacula restart

11. Make Directory backup so that Storage Daemon can store backups in it
mkdir /backup

12. Verify bacula-dir.conf

#############################
bacula-dir.conf
#############################

@/usr/local/bacula/conf/bacula_client_jobs.conf

Director {                            # define myself
Name = MyVM1-dir
DIRport = 9101                # where we listen for UA connections
QueryFile = “/usr/local/bacula/query.sql”
WorkingDirectory = “/usr/local/bacula/working”
PidDirectory = “/usr/local/bacula/working”
Maximum Concurrent Jobs = 1
Password = “b@cUl@”         # Console password
Messages = Daemon
}

Schedule {
Name = “Weekly”
Run = Full 1st sun at 23:05
Run = Differential 2nd-5th sun at 23:05
Run = Incremental mon-sat at 23:05
}

Storage {
Name = FileStr
Address = 10.28.79.164
SDPort = 9103
Password = “b@cUl@”
Device = FileStorage
Media Type = File
}

Catalog {
Name = MyCatalog
# Uncomment the following line if you want the dbi driver
# dbdriver = “dbi:mysql”; dbaddress = 127.0.0.1; dbport =
dbname = “bacula”; dbuser = “bacula”; dbpassword = “b@cUl@”
}

Messages {
Name = Standard
mailcommand = “/usr/local/bacula/bsmtp -h localhost -f \”\(Bacula\) \<%r\>\” -s \”Bacula: %t %e of %c %l\” %r”
operatorcommand = “/usr/local/bacula/bsmtp -h localhost -f \”\(Bacula\) \<%r\>\” -s \”Bacula: Intervention needed for %j\” %r”
mail = farhan.umer@nxvt.com = all, !skipped
operator = farhan.umer@nxvt.com = mount
console = all, !skipped, !saved
append = “/usr/local/bacula/working/log” = all, !skipped
catalog = all
}

Messages {
Name = Daemon
mailcommand = “/usr/local/bacula/bsmtp -h localhost -f \”\(Bacula\) \<%r\>\” -s \”Bacula daemon message\” %r”
mail = farhan.umer@nxvt.com = all, !skipped
console = all, !skipped, !saved
append = “/usr/local/bacula/working/log” = all, !skipped
}

Pool {
Name = File
Pool Type = Backup
Recycle = yes                       # Bacula can automatically recycle Volumes
AutoPrune = yes                     # Prune expired volumes
Label Format = “Vol-”
Volume Retention = 365 days         # one year
Storage = FileStr
Maximum Volume Bytes = 1G          # Limit Volume size to something reasonable
Maximum Volumes = 100               # Limit number of Volumes in Pool
}

###################################
bacula-sd.conf
###################################

Storage {                             # definition of myself
Name = MyVM1-sd
SDPort = 9103                  # Director’s port
WorkingDirectory = “/usr/local/bacula/working”
Pid Directory = “/usr/local/bacula/working”
Maximum Concurrent Jobs = 20
}

Director {
Name = MyVM1-dir
Password = “b@cUl@”
}

Device {
Name = FileStorage
Media Type = File
Archive Device = /backup
LabelMedia = yes;                   # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes;               # when device opened, read it
RemovableMedia = no;
AlwaysOpen = yes;
}

Messages {
Name = Standard
director = MyVM1-dir = all
}

####################################
bacula-fd.conf
####################################

Director {
Name = MyVM1-dir
Password = “b@cUl@”
}

FileDaemon {                          # this is me
Name = MyVM1-fd
FDport = 9102                  # where we listen for the director
WorkingDirectory = /usr/local/bacula/working
Pid Directory = /usr/local/bacula/working
Maximum Concurrent Jobs = 20
}

Messages {
Name = Standard
director = MyVM1-dir = all, !skipped, !restored
}
#####################################
Job definition
mkdir /usr/local/bacula/conf/
vi /usr/local/bacula/conf/bacula_client_jobs.conf
#####################################

# Client (File Services) to backup
Client {
Name = Bacula-fd
Address =     10.28.79.164      # Use a fully qualified name here or system actual IP. Don’t use localhost or 127.0.0.1
FDPort = 9102
Catalog = MyCatalog
Password = “b@cUl@”                    # password for FileDaemon
File Retention = 30 days            # 30 days
Job Retention = 6 months            # six months
AutoPrune = yes                     # Prune expired Jobs/Files
}

# List of files to be backed up
FileSet {
Name = “Full Set”
Include {
Options {
signature = MD5
compression = GZIP
}
File = /usr/local/bacula
}
Exclude {
File = /usr/local/bacula/working
File = /tmp
File = /proc
File = /tmp
File = /.journal
File = /.fsck
}
}

# Default restore job to restore any backup to bacula /tmp
# From /tmp we will move to restore data to desired server
Job {
Name = “RestoreFiles”
Type = Restore
Client=Bacula-fd
FileSet=”Full Set”
Storage = FileStr
Pool = File
Messages = Standard
Where = /tmp/restores
}

# Default backup job to backup bacula
Job {
Name = “Bacula-Backup”
Type = Backup
Level = Full
Client = Bacula-fd
FileSet = “Full Set”
Schedule = “Weekly”
Storage = FileStr
Messages = Standard
Pool = File
Priority = 10
Write Bootstrap = “/usr/local/bacula/working/%c.bsr”
}

###########################################################################
Installation of Webacual on Bacula Server (Ubuntu)

https://dev.uabgrid.uab.edu/wiki/WebaculaInstallation

http://www.java-tutorial.ch/ubuntu/webacula-installation-on-ubuntu

[Translate] http://www.tux.in.ua/articles/1935
###########################################################################

1. Install required packages

apt-get install apache2 php5 libapache2-mod-php5 php5-cli php5-mysql php5-gd zend-framework

apt-get install apache2
apt-get install php5 libapache2-mod-php5 php5-cli php5-mysql

2. Check and enable the required apache modules
a2enmod php5
a2enmod rewrite

3. Create a dir in /var/www/webacula where webaula files will be stored. Download Webacula from http://sourceforge.net/projects/webacula/files/webacula/

mkdir /var/www/webacula
cd /var/www/webacula
wget http://sourceforge.net/projects/webacula/files/webacula/5.0.3/webacula-5.0.3.tar.gz

4. Extract webacula
tar -zxf webacula-5.0.3.tar.gz
cd webacula-5.0.3/
mv /var/www/webacula/webacula-5.0.3/* /var/www/webacula

5. Change the ownership of webacula directory to apache user ‘www-data’

chown -R www-data:www-data /var/www/webacula

6. Check the requirements and in case some of the requirements are missing install the required libraries
php5 /var/www/webacula/install/check_system_requirements.php

7 Creates system group account (if not yet created):
groupadd bacula

Add apache to bacula group:
usermod -aG bacula www-data

check the group of user bacula
cat /etc/group | grep bacula
output:    bacula:x:1001:www-data

8. Modify config.ini file of webacula, In the general section add root user and passwd of mysql
vi /var/www/webacula/application/config.ini

———-Actual——- config.ini ——–Snip————–
[general]
db.adapter = PDO_MYSQL
db.config.host = localhost
db.config.username = bacula                # Change User Name
db.config.password =b@cUl@                # Change Password
db.config.dbname = bacula                # Change DB if required

def.timezone = “Europe/Minsk”

bacula.sudo = “”                    # Remove sudo path from here
bacula.bconsole = “/usr/local/bacula/bconsole”        # Change bconsole path
bacula.bconsolecmd = “-n -c /usr/local/bacula/bconsole.conf” # Change bconsole configuration file path

tmpdir = “/tmp”


# Remaining File doesn’t need any change

————————————————————

9. Allow Apache to execute bconsole file using bconsole.conf configuration file (as apache is now added to bacula group)
chown root:bacula /usr/local/bacula/bconsole
chmod 750 /usr/local/bacula/bconsole

chown root:bacula /usr/local/bacula/bconsole.conf
chmod 640 /usr/local/bacula/bconsole.conf

To Check :
su -l apache -s /bin/sh -c “/usr/bin/sudo /usr/local/bacula/bconsole -n -c /usr/local/bacula/bconsole.conf”

10. Create a configuration file for Apache /etc/apache2/sites-available/webacula
vi /etc/apache2/sites-available/webacula

———-Actual——- webacula.conf ——–Snip————–
Alias “/webacula”  “/var/www/webacula/html”
<Directory “/var/www/webacula/html”>
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Allow from 127.0.0.1
# your network
Allow from 172.16.171.0/255.255.255.0

AuthType Basic
AuthName “Webacula”
AuthUserFile       /etc/apache2/webacula.users
Require valid-user
</Directory>
—————————————————————

11. Enable site webacula and reload apache.

a2ensite webacula
/etc/init.d/apache2 reload

12. Add a apache user that can login webacula

htpasswd -c /etc/apache2/webacula.users admin
New password: b@cUl@

13. Edit your htaccess file to look like this.

vi /var/www/webacula/html/.htaccess
#SetEnv APPLICATION_ENV development
SetEnv APPLICATION_ENV production
php_flag magic_quotes_gpc off
php_flag register_globals off
RewriteEngine On

# edit RewriteBase if necessary
RewriteBase   /webacula
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

14. Reload Apache

/etc/init.d/apache2 reload

15. To check apache rewrite module status
apachectl -t -D DUMP_MODULES 2>&1 | grep rewrite
output:    rewrite_module (shared)

16. If got zend framework include error Install Zend using Synaptic of apt-get, Remove the preconfigured Zend folder (if any)

rmdir /var/www/webacula/library/Zend

Assuming Zend framework library has been install in /usr/share/php/libzend-framework-php/
Create a symbolic link to the Zend-Framework

ln -s /usr/share/php/libzend-framework-php/Zend /var/www/webacula/library/Zend

Restart Apache
service apache2 restart

0. PHP Fatal error: Uncaught exception ‘Zend_Exception’ with message ‘Bacula version mismatch for the Catalog database. Wanted 12, got 14
Workaround.

vi /var/www/webacula/html/index.php

change line from
define(‘BACULA_VERSION’, 12); // Bacula Catalog version –> define(‘BACULA_VERSION’, 14);

17. Increase values in /etc/php5/apache2/php.ini
vi /etc/php5/apache2/php.ini
memory_limit = 128M
max_execution_time = 300

0. To show messages of the Job output, you must add a line to the bacula-dir.conf and restart Bacula Director ::

Messages {
Name = Standard

catalog = all, !skipped, !saved
}
18. visudo
www-data ALL=NOPASSWD: /usr/bin/bconsole
19. Acess URL:
http://%5Bserver.address%5D/webacula

Advertisements