Bareos on Arch linux – part II – Managing and monitoring tools

bareos-full-logo
Bareos on Arch linux – last time we installed backup system and successfully run all components. And now? We need to have applications to handle  this system. To install Bareos on Arch Linux, refer the following link.
In this tutorial we can learn how to install tools for managing and monitoring Bareos. It will cover all known possibilities I know.

1. CLI

The first, for pure linux user, choice is via CLI (command line interface). All needed we have installed last time. It include:

bconsole - CLI admin tool
bareos-database-tools - CLI tools with database dpendencies (dbcheck, bscan)
bareos-tools - CLI tools (bcopy, bextract, bls, bregeq, bwild)
The most important is bconsle which can help us with all tasks we will need to do. How to configure backup system to do its job we will show on next tutorial.
$ sudo bconsole
Connecting to Director unixmen:9101
1000 OK: unixmen-dir Version: 14.2.5 (27 May 2015)
Enter a period to cancel a command.
*help
 Command Description
 ======= ===========
 add Add media to a pool
 autodisplay Autodisplay console messages
 automount Automount after label
 cancel Cancel a job
 configure Configure director
 create Create DB Pool from resource
 delete Delete volume, pool or job
 disable Disable a job/client/schedule
 enable Enable a job/client/schedule
 estimate Performs FileSet estimate, listing gives full listing
 exit Terminate Bconsole session
 export Export volumes from normal slots to import/export slots
 gui Non-interactive gui mode
 help Print help on specific command
 import Import volumes from import/export slots to normal slots
 label Label a tape
 list List objects from catalog
 llist Full or long list like list command
 messages Display pending messages
 memory Print current memory usage
 mount Mount storage
 move Move slots in an autochanger
 prune Prune records from catalog
 purge Purge records from catalog
 quit Terminate Bconsole session
 query Query catalog
 restore Restore files
 relabel Relabel a tape
 release Release storage
 reload Reload conf file
 rerun Rerun a job
 resolve Resolve a hostname
 run Run a job
 status Report status
 setbandwidth Sets bandwidth
 setdebug Sets debug level
 setip Sets new client address -- if authorized
 show Show resource records
 sqlquery Use SQL to query catalog
 time Print current time
 trace Turn on/off trace to file
 unmount Unmount storage
 umount Umount - for old-time Unix guys, see unmount
 update Update volume, pool or stats
 use Use specific catalog
 var Does variable expansion
 version Print Director version
 wait Wait until no jobs are running
When at a prompt, entering a period cancels the command.

*

2. GUI

The GUI tools to manage and monitor Bareos include  bat (bareos admin tool) and tray-monitor.
To use them wee need to install some desktop environment (DE) like my preferred Xfce4.
Since this tutorial is not focused to install these parts let’s go quickly to install all we need to run DE and desktop manager like lxdm.

The first we need to install Xorg server.

$ sudo pacman -Sy xorg
:: Synchronizing package databases...
 core 121.7 KiB 1014K/s 00:00 [##################################################] 100%
 extra 1817.5 KiB 1165K/s 00:02 [##################################################] 100%
 community 2.8 MiB 1000K/s 00:03 [##################################################] 100%
 archlinuxfr is up to date
:: There are 72 members in group xorg:
:: Repository extra
 1) xf86-input-evdev 2) xf86-input-joystick 3) xf86-input-keyboard 4) xf86-input-libinput 5) xf86-input-mouse 
6) xf86-input-synaptics 7) xf86-input-vmmouse 8) xf86-input-void 9) xf86-video-ark 10) xf86-video-ati 
11) xf86-video-dummy 12) xf86-video-fbdev 13) xf86-video-glint 14) xf86-video-i128 15) xf86-video-intel 
16) xf86-video-mach64 17) xf86-video-neomagic 18) xf86-video-nouveau 19) xf86-video-nv 20) xf86-video-openchrome 
21) xf86-video-r128 22) xf86-video-savage 23) xf86-video-siliconmotion 24) xf86-video-sis 25) xf86-video-tdfx 
26) xf86-video-trident 27) xf86-video-vesa 28) xf86-video-vmware 29) xf86-video-voodoo 30) xorg-bdftopcf
31) xorg-docs 32) xorg-font-util 33) xorg-fonts-100dpi 34) xorg-fonts-75dpi 35) xorg-fonts-encodings 
36) xorg-iceauth 37) xorg-luit 38) xorg-mkfontdir 39) xorg-mkfontscale 40) xorg-server 41) xorg-sessreg 
42) xorg-setxkbmap 43) xorg-smproxy 44) xorg-x11perf 45) xorg-xauth 46) xorg-xbacklight 47) xorg-xcmsdb 
48) xorg-xcursorgen 49) xorg-xdpyinfo 50) xorg-xdriinfo 51) xorg-xev 52) xorg-xgamma 53) xorg-xhost 
54) xorg-xinput 55) xorg-xkbcomp 56) xorg-xkbevd 57) xorg-xkbutils 58) xorg-xkill 59) xorg-xlsatoms 
60) xorg-xlsclients 61) xorg-xmodmap 62) xorg-xpr 63) xorg-xprop 64) xorg-xrandr 65) xorg-xrdb 
66) xorg-xrefresh 67) xorg-xset68) xorg-xsetroot 69) xorg-xvinfo 70) xorg-xwd 71) xorg-xwininfo 72) xorg-xwud
Enter a selection (default=all):   //just hit ENTER and install all

Then install DE – Xfce4

$ sudo pacman -S xfce4 xfce4-goodies
:: There are 17 members in group xfce4:
:: Repository extra
 1) exo 2) garcon 3) gtk-xfce-engine 4) thunar 5) thunar-volman 6) tumbler 7) xfce4-appfinder 
8) xfce4-mixer 9) xfce4-panel 10) xfce4-power-manager 11) xfce4-session 12) xfce4-settings 13) xfce4-terminal 14) xfconf 15) xfdesktop 16) xfwm4 17) xfwm4-themes
Enter a selection (default=all):    // hit ENTER to install all

…. and now some desktop manager – lxdm

$ sudo pacman -S lxdm

Enable this on startup and run:

$ sudo systemctl enable lxdm
$ sudo systemctl start lxdm

bareos on arch linux

and you can login to Xfce4.
bareos on arch linux
OK. All is done to install our needed packages. To install them just run:

$ yaourt bareos-bat
Installation of bareos-bat also include bareos-traymonitor
$ yaourt bareos-bat
1 aur/bareos-bat 14.2.5-3 [installed] (2)
 Bareos - Backup Archiving REcovery Open Sourced - Admin Tool (GUI)
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
==> -------------------------------------------------------
==> 1
==> Downloading bareos-bat PKGBUILD from AUR...
x .SRCINFO
x PKGBUILD
x PKGBUILD.common
bareos-bat 14.2.5-3 (2015-06-10 02:32)
( Unsupported package: Potentially dangerous ! )
==> Edit PKGBUILD ? [Y/n] ("A" to abort)
==> ------------------------------------
==> n
==> WARNING: This PKGBUILD describes a split package.
==> Specific package options are unknown
==> bareos-x11 dependencies:
 - sqlite (already installed)
 - libmariadbclient (already installed)
 - postgresql-libs (already installed)
==> Continue building bareos-bat ? [Y/n]
==> ------------------------------------
==> 
==> Building and installing package
==> This PKGBUILD provides " bareos-traymonitor bareos-bat "
==> Install only bareos-bat ? [Y/n]
==> -------------------------------
==>                                   // hit N to build all packages
… and after couple of minutes the packages are prepared – co let’s go to install them.
==> Entering fakeroot environment...
==> Starting package_bareos-traymonitor()...
==> Tidying install...
 -> Purging unwanted files...
 -> Removing libtool files...
 -> Removing static library files...
 -> Compressing man and info pages...
 -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "bareos-traymonitor"...
 -> Generating .PKGINFO file...
 -> Generating .MTREE file...
 -> Compressing package...
==> Starting package_bareos-bat()...
==> Tidying install...
 -> Purging unwanted files...
 -> Removing libtool files...
 -> Removing static library files...
 -> Compressing man and info pages...
 -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "bareos-bat"...
 -> Generating .PKGINFO file...
 -> Generating .MTREE file...
 -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: bareos-x11 14.2.5-3 (Sat Oct 3 21:02:36 CEST 2015)

==> Continue installing bareos-x11 ? [Y/n]
==> [v]iew package contents [c]heck package with namcap
==> ---------------------------------------------------
==> 

loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (2) bareos-bat-14.2.5-3 bareos-traymonitor-14.2.5-3

Total Installed Size: 1.49 MiB
Net Upgrade Size: 0.11 MiB

:: Proceed with installation? [Y/n] 
(2/2) checking keys in keyring [##################################################] 100%
(2/2) checking package integrity [##################################################] 100%
(2/2) loading package files [##################################################] 100%
(2/2) checking for file conflicts [##################################################] 100%
(2/2) checking available disk space [##################################################] 100%
(1/2) installing bareos-bat [##################################################] 100%
(2/2) installing bareos-traymonitor [##################################################] 100%
Optional dependencies for bareos-traymonitor
 openssl: network encryption between daemons [installed]
[archlinux@unixmen ~]$ 

Configuration needs little invention. Edit /etc/bareos/bareos-dir.conf and copy password from section director to /etc/bareos/bat.conf

$ sudo nano /etc/bareos/bareos-dir.conf
Director { # define myself
 Name = unixmen-dir
 QueryFile = "/usr/lib/bareos/scripts/query.sql"
 Maximum Concurrent Jobs = 10
 Password = "pPQqd0GXpWJ1r2jxUmfiH5Pnm4Lb4W2TlG3hKe5TIKBy" # Console password      //copy this password
 Messages = Daemon
 Auditing = yes
$ sudo nano /etc/bareos/bat.conf
#
# Bareos Administration Tool (bat) configuration file
#
Director {
 Name = unixmen-dir
 DIRport = 9101
 address = unixmen
 Password = "pPQqd0GXpWJ1r2jxUmfiH5Pnm4Lb4W2TlG3hKe5TIKBy"          // paste password
}

Since to access configuration files we need root privileges it is necessary to run bat as root. To launch root x-applications under under user just launch terminal and write commnads:

$ xhost +
$ sudo bat

and we can work with bareos via GUI application – bat. Later will show how to configure system to run bat as a normal user.

bareos on arch linux

3. Web based applications

Web base applications do not need DE and direct access to backup server. They can be used via web browser everywhere and accessible for many people according the access level they have.

Webmin

Webmin is a web-based interface for system administration of Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.

The first we have to install webmin:

$ yaourt webmin
1 aur/webmin 1.760-1 (3)
 a web-based interface for system administration
==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3)
==> -------------------------------------------------------
==> 1

Install all packages it will need and also the webmin. Start it and enable at startup:

$ sudo systemctl enable webmin
$ sudo systemctl start webmin

Second – install some web browser – like firefox:

$ sudo pacman -S firefox

Now you can go to your DE and launch firefox. Then point to https://localhost:10000
user root account to your system:

bareos on arch linux

 

bareos on arch linux

Just now install bacula and perl  module to webmin:

$ sudo pacman -S wget
$ wget http://download.webmin.com/download/modules/bacula-backup.wbm.gz
$ sudo  /opt/webmin/install-module.pl bacula-backup.wbm.gz
$ sudo pacman -S perl-dbd-mysql

login again into webmin or refresh modules and configure bacula modules to bareos system. Module can be found under Un-used modules. Make right configuration of this module – choose MySQL database and user – bareos. In our tutorial we did not set the password. Leave it empty

 bareos on arch linux

bareos on arch linux

Bareos-webui

The bareos-webui is a free software tool written in PHP, intended to monitor and manage Bareos over the web. The webui is based on Zend Framework 2, an open source framework for developing web applications and services using PHP 5.3+.
Features

  • Intuitive web interface
  • Usage of multiple directors
  • Individual accounts and ACL support via Bareos restricted named consoles
  • Displays detailed information about Jobs, Clients, Filesets, Pools, Volumes, Storages, Director, Scheduler and Logs
  • Run, rerun, cancel and restore jobs
System requirements:

  • A working Bareos environment, Bareos >= 12.4 (depend on Bareos version, in our cas 12.4)
  • An Apache 2.x Webserver with mod-rewrite, mod-php5 and mod-setenv
  • PHP >= 5.3.3
    • PHP PDO Extension
    • PHP Sockets Extension
    • PHP OpenSSL Extension
  • Zend Framework 2.2.x or later

The last version of Bareos-webui is 15.2 but  we have installed Bareos v.12.4 so  we need to use this link from github – Bareos-webui v14.2

So just now we install apache and php:

$ sudo pacman -Sy apache php php-apache

edit /etc/php/php.ini file and enable extensions we need:

$ sudo nano /etc/php/php.ini
;extension=exif.so
;extension=ftp.so
extension=gd.so                    //uncomment 
extension=gettext.so
;extension=gmp.so
extension=iconv.so               //uncomment
;extension=imap.so
;extension=intl.so
;extension=ldap.so
;extension=mcrypt.so
;extension=mssql.so
extension=mysql.so             //uncommnet
;extension=mysqli.so
;extension=odbc.so
;zend_extension=opcache.so
extension=openssl.so          //uncomment 
extension=pdo_mysql.so       //uncommnet
;extension=pdo_odbc.so
;extension=pdo_pgsql.so
;extension=pdo_sqlite.so
;extension=pgsql.so
;extension=phar.so
;extension=posix.so
;extension=pspell.so
;extension=shmop.so
;extension=snmp.so
;extension=soap.so
extension=sockets.so        //uncomment
;extension=sqlite3.so
;extension=sysvmsg.so

now edit /etc/httpd/conf/httpd.conf:

$ sudo nano /etc/httpd/conf/httpd.conf

comment LoadModule mpm_event_module modules/mod_mpm_event.so by adding # and uncomment LoadModule mpm_prefork_module modules/mod_mpm_prefork.so, and also uncomment mod_rewrite

#LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule rewrite_module modules/mod_rewrite.so

and enable php modules by adding these lines:

LoadModule php5_module modules/libphp5.so
Include conf/extra/php5_module.conf

find the section  <IfModule mime_module> and include lines:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Enable httpd at startup and start it:

$ sudo systemctl enable httpd
$ sudo systemctl start httpd

and test if Apache is working in web-browser – http://localhost

bareos on arch linux

Install Zend framework2

$ yaourt zendframework2

and add this line SetEnv ZF2_PATH /usr/share/zendframework2/library to apache config file /etc/httpd/conf/httpd.conf

$ sudo nano /etc/httpd/conf/httpd.conf

It is also to neccessary to modify open_basedir in php.ini config file

$ sudo nano /etc/php/php.ini
; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
;open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/     //comment it (not secure)

; open_basedir, if set, limits all file operations to the defined directory
; and below. This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file.
; http://php.net/open-basedir
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/usr/share/zendframework2/  
//or add path to zendframework

restart httpd service:

$ sudo systemctl restart httpd

Everything is prepared to install bareos-webui.

Install bareos-webui

Download the source code and uzip and move to webapss directory:

$ wget https://github.com/bareos/bareos-webui/archive/bareos-14.2.zip
$ sudo pacman -S unzip
$ sudo mkdir /usr/share/webapps     //only  if folder does not exist
$ sudo chmod 777 /usr/share/webapps/
$ sudo mv bareos-webui-bareos-14.2/ /usr/share/webapps/bareos-webui

Configure apache to work with Bareos

$ sudo cp /usr/share/webapps/bareos-webui/install/apache/bareos-webui.conf /etc/httpd/conf/extra

and configure it to our needs:

# Bareos WebUI Apache configuration file
#

# Environment Variable for Application Debugging
# Set to "development" to turn on debugging mode or
# "production" to turn off debugging mode.
<IfModule env_module>
SetEnv "APPLICATION_ENV" "production"
</IfModule>

Alias /bareos-webui /usr/share/webapps/bareos-webui/public      //correct to right path

<Directory /usr/share/webapps/bareos-webui/public>

Options FollowSymLinks
AllowOverride All

# Following module checks are only done to support
# Apache 2.2,
# Apache 2.4 with mod_access_compat and
# Apache 2.4 without mod_access_compat
# in the same configuration file.
# Feel free to adapt it to your needs.

# Apache 2.2
#<IfModule !mod_authz_core.c>          //comment or delete these lines
#Order deny,allow
#Allow from all
#</IfModule>

# Apache 2.4
<IfModule mod_authz_core.c>
<IfModule mod_access_compat.c>
Order deny,allow
</IfModule>
Require all granted
</IfModule>

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /bareos-webui
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

<IfModule mod_php5.c>
php_flag magic_quotes_gpc off
php_flag register_globals off
</IfModule>

</Directory>

change configuration of httpd.conf:

$ sudo nano /etc/httpd/conf/httpd.conf

and add these lines at the bottom:

#Bareos-webui
Include conf/extra/bareos-webui.conf

Restart httpd service:

$ sudo systemctl restart httpd

Prepare configuration files and change them:

$ sudo mkdir /etc/bareos-webui
$ sudo cp /usr/share/webapps/bareos-webui/install/directors.ini /etc/bareos-webui
$ sudo nano  /etc/bareos-webui/directors.ini
; Bareos WebUI Configuration
; File: /etc/bareos-webui/directors.ini
;
;
; Section localhost-dir
;
[localhost-dir]

; Enable or disable section. Possible values are "yes" or "no", the default is "yes".
enabled = "yes"

; Possible values are "postgresql" or "mysql", the default is "postgresql"
dbdriver = "mysql"               //change to mysql 

; Fill in the IP-Address or FQDN of your catalog DB
dbaddress = "localhost"

; Default values are corresponding to your dbriver, e.g 5432 or 3306
dbport = 3306               //change to 3306

; Default is "bareos"
dbuser = "bareos"          //change to bareos user   

; No default value
dbpassword = ""

; Default is set to "bareos"
dbname = "bareos"

; Fill in the IP-Address or FQDN of you director.
diraddress = "localhost"

; Default value is 9101

; Note: TLS has not been tested and documented, yet.
;tls_verify_peer = false
;server_can_do_tls = false
;server_requires_tls = false
;client_can_do_tls = false
;client_requires_tls = false
;ca_file = ""
;cert_file = ""
;cert_file_passphrase = ""
;allowed_cns = ""

;
; Section another-host-dir
;
[another-host-dir]
enabled = "no"
dbdriver = "mysql"
dbaddress = ""
dbport = 3306
dbuser = "bareos_webui"
dbpassword = ""
dbname = "bareos"
diraddress = ""
dirport = 9101
; Note: TLS has not been tested and documented, yet.
;tls_verify_peer = false
;server_can_do_tls = false
;server_requires_tls = false
;client_can_do_tls = false
;client_requires_tls = false
;ca_file = ""
;cert_file = ""
;cert_file_passphrase = ""
;allowed_cns = ""
dbaddress = ""
dbport = 3306
dbuser = "bareos_webui"
dbpassword = ""
dbname = "bareos"
diraddress = ""
dirport = 9101
; Note: TLS has not been tested and documented, yet.
;tls_verify_peer = false
;server_can_do_tls = false
;server_requires_tls = false
;client_can_do_tls = false
;client_requires_tls = false
;ca_file = ""
;cert_file = ""
;cert_file_passphrase = ""
;allowed_cns = ""

Prepare web-console user and credential and ACL’s:

$ sudo cp /usr/share/webapps/bareos-webui/install/bareos/bareos-webui.conf  /etc/bareos
$ sudo nano /etc/bareos/bareos-webui.conf

and change to your needs:

#
# Preparations:
#
# include this configuration file in bareos-dir.conf by
# @/etc/bareos/bareos-dir.d/bareos-webui.conf
#
#
# Restricted console used by bareos-webui
#
Console {
 Name = archlinux                  //change webconsole name
 Password = "unixmen"              //set password
 CommandACL = cancel, messages, rerun, restore, run, show, status, version
 Job ACL = *all*
 Schedule ACL = *all*
 Catalog ACL = *all*
 Pool ACL = *all*
 Storage ACL = *all*
 Client ACL = *all*
 FileSet ACL = *all*
 #Where ACL =
}

finally add line  @/etc/bareos/bareos-webui.conf at the bottom of  bareos-dir.conf

$ sudo nano /etc/bareos/bareos-dir.conf

To enable apache to read configuration files make:

$ sudo chown -R root:http /etc/bareos
$ sudo chmod -R 775 /etc/bareos

and add yourself to http group:

$ sudo usermod -a -G http archlinux      //add your username

Lines above also enable to run bat as a normal user.

Just only to be sure restart all services (not needed):

$ sudo systemctl restart bareos-dir
$ sudo systemctl restart httpd

and you can connect via web browser – http://localhost/bareos-webui  with credentials – archlinux  – unixmen

bareos on arch linux

bareos on arch linux

Webacula

Webacula – web interface of a Bareos/Bacula backup system. Unfortunately, it seems to be no longer under active development by the original author.

Webacula basic features:

  • Bacula and Webacula ACLs (Access Control Lists) implemented. ACLs stored in Bacula database in Webacula tables
  • Full supported MySQL, PostgreSQL and Sqlite databases
  • Run Job
  • Restore all files or selected files from Job by JobId
  • Restore the most recent backup for a client
  • Restore backup for a client before a specified time
  • Show Timeline for Jobs
  • Mount, umount Storages
  • Show Jobs which executed with errors
  • Show a condition of your Volumes
  • Show scheduled Jobs (at 24 hours forward)
  • Show all running Jobs
  • Show terminated Jobs (executed in last 24 hours)
  • Search Jobs on several conditions
  • Web (ajax) terminal to Bacula Console
  • The detailed information on Pools, Volumes, Storages and Clients
  • Logbook. Logbook – is simple electronic journal of backups. Records in logbook are insert, modify, delete manually by the operator. Records can contain links (usual web-links on which it is possible to click) to Bacula Jobs or links to other records of this logbook. In logbook insert records, for example, about Jobs, failures of the equipment, supernumerary situations, etc. Logbook stored in a separate database “webacula”, now it is supported MySQL, PostgreSQL and Sqlite.
  • RSS feed
  • Multilingual support – standard gettext (*.mo) files. Currently supported languages: English, Czech, French, German, Italian, Portuguese Brazil, Russian, Spanish.

System Requirements:

  • Supported MySQL, PostgreSQL and Sqlite databases
  • Zend Framework version 1.8.3 or later
  • Zend Framework is built with object-oriented PHP 5 and requires PHP 5.2.4 or later with PDO extension active
  • Apache and mod_rewrite
  • Installed php-gd package

For our purpose we will use bareos fork of webacula v.5

Install Zend framework

$ yaourt zendframework

Install and configure webacula

$ wget https://github.com/bareos/contrib-webacula/archive/bareos-master.zip
$ unzip bareos-master.zip
$ sudo mv contrib-webacula-bareos-master/ /usr/share/webapps/webacula

Enable it for http user.

$ sudo chown -R http /usr/share/webapps/webacula

Make symlink to zend library

$ ln -s /usr/share/zendframework/library/Zend /usr/share/webapps/webacula/library/Zend

Maker configuration folder a make a symlink of config. file

$ sudo mkdir /etc/webacula
$ sudo ln -s /usr/share/webapps/webacula/application/config.ini /etc/webacula

and update the config file.

$sudo nano /etc/webacula/config.ini
config.ini
; Webacula 5.5
;
[general]
;; supported adapters : PDO_MYSQL, PDO_PGSQL, PDO_SQLITE
db.adapter = PDO_MYSQL                        //adapter for MySQL
db.config.host = localhost
db.config.username = bareos                  //change to database user, according last tutorial bareos
db.config.password =                         //leave empty or write password for dtb user
;; for Sqlite db.config.dbname = "/full patch/bareos.db"
db.config.dbname = bareos
;; director.db.username: the database username
;; the Bareos/Bacula director uses to access the database.
;; This is required to grant this user the permissions
;; to read the webacula tables,
;; otherwise the default database backup script fails.
director.db.username = bareos
;; Bacula/Bareos catalog version
;; If you are unsure what value to set here, please consult your bareos/bacula catalog dat$
;; Supported bacula catalog versions: 12
;; Supported bareos catalog versions: 2001
catalog.version = 2003               //change to 2003 otherwise you will get version error
;; see http://www.php.net/timezones
; def.timezone = "UTC"
; def.timezone = "Europe/Berlin"
;; if locale undefined, webacula use autodetect
;; avaliable locales : en, cs, de, fr, pt_BR, ru, it, es
; locale = "en"
;; see INSTALL file for details
bacula.sudo = ""
bacula.bconsole = "/usr/bin/bconsole"                           //correct right path
bacula.bconsolecmd = "-n -c /etc/bareos/bconsole.conf"          //correct right path

Prepare MySQL database

$ sudo cp /usr/share/webapps/webacula/install/webacula-config /usr/sbin

make tables and ACL’s

$ sudo sh /usr/share/webapps/webacula/install/MySql/10_make_tables.sh
$ sudo sh /usr/share/webapps/webacula/install/MySql/20_acl_make_tables.sh

This will also make web user root with password CHANGEME.

Prepare apache configuration

$ sudo cp /usr/share/webapps/webacula/install/apache/webacula.conf /etc/httpd/conf/extra/

and change this to the right value according file bellow:

Bareos WebUI Apache configuration file
#
# Environment Variable for Application Debugging
# Set to "development" to turn on debugging mode or
# "production" to turn off debugging mode.
#<IfModule env_module>
# SetEnv "APPLICATION_ENV" "production"
#</IfModule>
Alias /webacula /usr/share/webapps/webacula/html       //change to correct path
<Directory /usr/share/webapps/webacula/html>           //change to correct path
Options FollowSymLinks
 AllowOverride All
# Following module checks are only done to support
 # Apache 2.2,
 # Apache 2.4 with mod_access_compat and
 # Apache 2.4 without mod_access_compat
 # in the same configuration file.
 # Feel free to adapt it to your needs.
# Apache 2.2
# <IfModule !mod_authz_core.c>
 # Order deny,allow
 # Allow from all
 # </IfModule>
# Apache 2.4
 <IfModule mod_authz_core.c>
 <IfModule mod_access_compat.c>
 Order deny,allow
 </IfModule>
 Require all granted
 </IfModule>
<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteBase /webacula
 RewriteCond %{REQUEST_FILENAME} -s [OR]
 RewriteCond %{REQUEST_FILENAME} -l [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^.*$ - [NC,L]
 RewriteRule ^.*$ index.php [NC,L]
 </IfModule>
<IfModule mod_php5.c>
 php_flag magic_quotes_gpc off
 php_flag register_globals off
 </IfModule>
</Directory>

tell apache where to find webacula config. Edit  /etc/httpd/conf/httpd.conf

$ sudo nano /etc/httpd/conf/httpd.conf

and add these lines

#Webacula
Include conf/extra/webacula.conf

finally restart httpd service

$ sudo systemctl restart httpd

Now open web browser and point to http://localhost/webacula and use user root and password CHANGEME

bareos on arch linux

bareos on arch linux

Congratulation! That’s all and we have all working.

Conclusion

Just now we have fully working installation of  Bareos backup system and all application to monitoring and managing it. As  I think Arch linux has one of the best wiki pages so you can find many info there.

Last part of this tutorial series will show you how to configure and setup Bareos to do its job – backup and recover our valuable data.

Reference links: