The main advantages of Bacula-Web are the simplicity of installation, easy to configure and it’s totally web based without needing local fat client install, configure and upgrades.
Bacula-Web provide you with a lot of informations about your last backup jobs, restore jobs, volumes, pools and so on …
If you’re interested in full detailled features list, it may be found in the documentation section. You will be surprised at the way the ease of use of the Bacula-Web tool.
The only things you need is a well working and configured LAMP server and a valid database connection to your Bacula catalog.
Bacula-Web GUI (graphical user interface) is mostly written in PHP and is compatible with your prefered OS such as Red Hat, Centos, Fedora, Debian, Gentoo, FreeBSD, etc.
Requirements
Before installing Bacula-Web on your server, you must ensure that your system fullfill Bacula-Web requirements
ssh (root access) on the server
Apache Web server (at least version 2)
PHP version >= 5 with
Gettext support
GD library support (used for graphs)
TrueType support (optional)
PHP PDO and PHP support for MySQL, postgreSQL or SQLite (depend your Bacula setup)
Session support
Database connectivity to your Bacula director(s) database(s)
supported database MySQL, postgreSQL or SQLite
Install required packages on RedHat / Centos / Fedora
Install Apache web server
1. $ sudo yum install httpd
2. $ sudo chkconfig httpd on
3. $ sudo service httpd start
Install PHP
Install PHP and PHP support for the database you’ve installed for Bacula
with MySQL database support
1. $ sudo yum install php php-gd php-gettext php-mysql php-pdo
with postgreSQL database support
1. $ sudo yum install php php-gd php-gettext php-pgsql php-pdo
with SQLite database support
1. $ sudo yum install php php-gd php-gettext php-pdo
Change SQLite database file permissions
Assuming that the bacula database file is located under /var/spool/bacula
1. # chmod -v 705 /var/spool/bacula
2. # chmod -v 704 /var/spool/bacula/bacula.db
Move into Apache directory
// RedHat/Centos
# cd /var/www/html
// Debian / Ubuntu
# cd /var/www/
Download the source tarball
# wget http://www.bacula-web.org/files/bacula-web.org/downloads/bacula-web-latest.tgz
Uncompress the archive
// Red Hat / Centos / Fedora
# tar -xzf bacula-web-latest.tgz -C /var/www/html/
Rename the folder
# mv -v bacula-web-x.x.x bacula-web
Change files/folders permissions
// On Centos / Red Hat
# chown -Rv apache ./bacula-web
// On Debian / Ubuntu
# chown -Rv www-data: ./bacula-web
# chmod -Rv u=rx,g=rx,o=rx ./bacula-web
Configuring Bacula-Web
From Bacula-Web root folder, copy the file config.php.sample as below
Please note that since version 5.1.0, the config file is a PHP script.
# cd application/config
# cp -v config.php.sample config.php
# chown -v apache: config.php
Languages
Bacula-Web have been translated in different language (thank you to all the contributors for their efforts).
English (default)
Spanish (last update by Juan Luis Francés Jiménez)
Italian (last update by Gian Domenico Messina (gianni.messina AT c-ict.it)
French (last update by Morgan LEFIEUX – comete AT daknet.org)
German (last update by Florian Heigl)
Swedish – Maintened by Daniel Nylander (po@danielnylander.se)
Portuguese Brazil – Last updated by J. Ritter (condector@gmail.com)
To change the default displayed language, modify the option in config.php (see below)
$config[‘language’] = ‘en_EN’; // (default language)
// Other available languages
// en_US (or en_UK)
// es_ES
// it_IT
// fr_FR
// de_DE
// sv_SV
// pt_BR
Options
As of version 5.2.11, the configuration file contain two new options described below
// Show inactive clients (hidden by default)
$config[‘show_inactive_clients’] = true;
// Hide empty pools (displayed by default)
$config[‘hide_empty_pools’] = false;
Database connection settings
// Bacula catalog label (used for catalog selector)
$config[0][‘label’] = ‘Backup Server’;
// Server
$config[0][‘host’] = ‘localhost’;
// Database name
$config[0][‘db_name’] = ‘bacula’;
// Database user
$config[0][‘login’] = ‘bacula’;
// Database user’s password
$config[0][‘password’] = ‘verystrongpassword’;
// Database type (mysql | pgsql | sqlite)
$config[0][‘db_type’] = ‘mysql’;
// Database port
$config[0][‘db_port’] = ‘3306’;
Single catalog (example)
$config[‘language’] = ‘en_EN’;
//MySQL bacula catalog
$config[0][‘label’] = ‘Backup Server’;
$config[0][‘host’] = ‘localhost’;
$config[0][‘login’] = ‘bacula’;
$config[0][‘password’] = ‘verystrongpassword’;
$config[0][‘db_name’] = ‘bacula’;
$config[0][‘db_type’] = ‘mysql’;
$config[0][‘db_port’] = ‘3306’;
Multiple catalogs (example)
<?php
//MySQL bacula catalog
$config[0][‘label’] = ‘Backup Server’;
$config[0][‘host’] = ‘localhost’;
$config[0][‘login’] = ‘bacula’;
$config[0][‘password’] = ‘verystrongpassword’;
$config[0][‘db_name’] = ‘bacula’;
$config[0][‘db_type’] = ‘mysql’;
$config[0][‘db_port’] = ‘3306’;
//PostgreSQL Lab serveur
$config[1][‘label’] = ‘Lab backup server’;
$config[1][‘host’] = ‘192.168.0.120’;
$config[1][‘login’] = ‘bacula’;
$config[1][‘password’] = ‘verystrongpassword’;
$config[1][‘db_name’] = ‘bacula’;
$config[1][‘db_type’] = ‘pgsql’;
$config[1][‘db_port’] = ‘5432’;
?>
Configuration example
Here’s below how your configuration file (config.php) could look like
<?php
// Language
$config[0][‘language’] = ‘en_EN’;
// Show inactive clients
$config[‘show_inactive_clients’] = false;
// Hide empty pools
$config[‘hide_empty_pools’] = true;
//MySQL bacula catalog
$config[0][‘label’] = ‘Backup Server’;
$config[0][‘host’] = ‘localhost’;
$config[0][‘login’] = ‘baculaweb’;
$config[0][‘password’] = ‘password’;
$config[0][‘db_name’] = ‘bacula’;
$config[0][‘db_type’] = ‘mysql’;
$config[0][‘db_port’] = ‘3306’;
// PostgreSQL bacula catalog
$config[1][‘label’] = ‘Prod Server’;
$config[1][‘host’] = ‘db-server.domain.com’;
$config[1][‘login’] = ‘bacula’;
$config[1][‘password’] = ‘otherstrongpassword’;
$config[1][‘db_name’] = ‘bacula’;
$config[1][‘db_type’] = ‘pgsql’;
$config[1][‘db_port’] = ‘5432’;
// SQLite bacula catalog
$config[2][‘db_type’] = ‘sqlite’;
$config[2][‘label’] = ‘bacula’;
$config[2][‘db_name’] = ‘/path/to/database’;
?>
Configure PHP
Update the timezone parameter in your PHP configuration in order to prevent Apache warning messages (see below)
Warning: mktime(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Europe/Berlin’ for ‘CEST/2.0/DST’ instead in /var/www/html/bacula-web/config/global.inc.php on line 62
Modify PHP configuration file
1. # File: /etc/php.ini
2. # For *BSD users, the file is located /usr/local/etc/php.ini
3. # Locate and modify the line below
4. date.timezone =
5. # with this value (for example)
6. date.timezone = Europe/Zurich
Reload Apache configuration
1. $ sudo service httpd reload || sudo /etc/init.d/httpd reload
Secure your web server
In order to secure the application folder and avoid exposing sensitive information contained in Bacula-Web configuration.
Edit the Apache configuration file as described below
Red Hat / Centos / Fedora
1. $ sudo vim /etc/httpd/conf.d/bacula-web.conf
Debian / Ubuntu
1.$ sudo vi /etc/apache2/sites-available/default
and add the content below
AllowOverride All
Then reload Apache to apply the configuration change
Centos / Red Hat
1. $ sudo /etc/init.d/httpd restart
Debian / Ubuntu
1. $ sudo /etc/init.d/apache2 restart
Upgrading / Moving Bacula-Web
Upgrading or moving your Bacula-Web installation is very easy
* Make a copy of the config file which is located under the folder application/config/config.php
* Ensure that you meet all system requirements
* Follow the steps described in the installation guide
* Replace the default config file with your own version
* Test the installation through the test page
Enjoy it
Testing Bacula-Web
After installing and configuring Bacula-Web, just ensure that Bacula-Web will work fine.
A test page exist for this purpose that check the following items
required package are succesfully installed
smarty template cache good permissions
php modules are installed and properly configured
To test your installation of Bacula-Web, follow this link
http://yourserveroripaddress/bacula-web/test.php
You should got the same result as shown in the screenshot below
For quick installation You can use the below Steps also on RHEL/Cent-OS
This example shows to configure on the environment like follows.
(1) director.server.world [10.0.0.60] Bacula Management Server – Director, Storage, Database Daemon
(2) file01.server.world [10.0.0.61] Bacula Client – File Daemon ( Backup Target )
Database is required on backends, so this example shows to use MySQL Server on Bacula Management Server. It’s possible to use PostgreSQL, SQLite, too
[1] Install Director and Storage component on Bacula Management Server.
[root@director ~]# yum -y install bacula-director-mysql bacula-storage-mysql bacula-console
[2]Create a database for Bacula.
[root@director ~]# /usr/libexec/bacula/grant_mysql_privileges -p
Enter password: # root password for MySQL
Privileges for user bacula granted on database bacula.
[root@director ~]# /usr/libexec/bacula/create_mysql_database -p
Enter password: # root password for MySQL
Creation of bacula database succeeded.
[root@director ~]# /usr/libexec/bacula/make_mysql_tables -p
Enter password: # root password for MySQL
Creation of Bacula MySQL tables succeeded.
[root@director ~]# mysql -u root -p # connect to MySQL
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.1.52 Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
# set password for Bacula
mysql> set password for bacula=password(‘password’);
Query OK, 0 rows affected (0.00 sec)
# set password for Bacula
mysql> set password for bacula@localhost=password(‘password’);
Query OK, 0 rows affected (0.00 sec)
# make sure settings
mysql> select user,host,password from mysql.user;
mysql> show databases;
mysql> use bacula;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
mysql> exit
Bye
See the below Image: