Installing Baculum

Overview

Installation process can be performed in two ways:

  • automatically using binary packages (deb or rpm) from a bacula.org package repository,

  • manually using the bacula-gui source archive.

Baculum packages for popular Linux distributions are available in the bacula.org repositories.

Requirements

Baculum API

  • Web server which supports URL rewriting,

  • PHP >= 5.4.0 with modules:

  • PHP PDO support: PDO PostgreSQL or PDO MySQL. If MySQL catalog database is used, correct PHP MySQL driver is the MySQL Native Driver (php-mysqlnd),

  • PHP BCMath module,

  • PHP DOM module,

  • PHP JSON module.

  • Access to local or remote Bacula Catalog database,

  • Bacula bconsole access,

  • If you are going to configure Bacula via Baculum, read/write access to Bacula configuration files for the web server user.

Baculum Web

  • Web server which supports URL rewriting,

  • PHP >= 5.4.0 with modules:

  • PHP cURL

  • PHP DOM

  • PHP JSON

  • PHP LDAP

Debian/Ubuntu

Package repositories

Import the public key into the APT trusted key list:

wget -qO - http://bacula.org/downloads/baculum/baculum.pub | apt-key add -

Create a new sources list file:

/etc/apt/sources.list.d/baculum.list

and write one from the following repositories in it:

Debian 9 Stretch

deb http://bacula.org/downloads/baculum/stable/debian stretch main
deb-src http://bacula.org/downloads/baculum/stable/debian stretch main

Debian 10 Buster

deb http://bacula.org/downloads/baculum/stable/debian buster main
deb-src http://bacula.org/downloads/baculum/stable/debian buster main

Ubuntu 18.04 Bionic

deb [ arch=amd64 ] http://bacula.org/downloads/baculum/stable/ubuntu bionic main
deb-src http://bacula.org/downloads/baculum/stable/ubuntu bionic main

Ubuntu 20.04 Focal

deb [ arch=amd64 ] http://bacula.org/downloads/baculum/stable/ubuntu focal main
deb-src http://bacula.org/downloads/baculum/stable/ubuntu focal main

Installation

The instalation consists of:

  • installing the Baculum Web,

  • installing the Baculum API.

Packages each of the Baculum components (Web and API) can be installed with one of the following web servers:

  • Apache,

  • Lighttpd.

Below you can find a list of all deb packages with a brief description:

  • Common packages for Baculum API and Baculum Web:

    • baculum-common - Common files for the Baculum API and the Baculum Web.

  • The Baculum API packages:

    • baculum-api - main the Baculum API package with application files,

    • baculum-api-apache2 - Apache web server configuration files for the Baculum API,

    • baculum-api-lighttpd - Lighttpd web server configuration files for the Baculum API.

  • The Baculum Web packages:

    • baculum-web - main the Baculum Web package with application files,

    • baculum-web-apache2 - Apache web server configuration files for the Baculum Web,

    • baculum-web-lighttpd - Lighttpd web server configuration files for the Baculum Web.

Baculum API

Baculum API with Apache web server

apt-get install baculum-common baculum-api baculum-api-apache2

After installation you must enable the rewrite Apache module:

a2enmod rewrite

There is also required to enable the baculum-api virtual host site:

a2ensite baculum-api

At the end please restart (or reload) the new Apache web server configuration:

systemctl restart apache2

Baculum API with Lighttpd web server

apt-get install baculum-common baculum-api baculum-api-lighttpd

After installation please start the Lighttpd web server:

systemctl start baculum-api-lighttpd

Baculum Web

Baculum Web with Apache web server

apt-get install baculum-common baculum-web baculum-web-apache2

After installation you must enable the rewrite Apache module:

a2enmod rewrite

There is also required to enable the baculum-web virtual host site:

a2ensite baculum-web

At the end please restart (or reload) the new Apache web server configuration:

systemctl restart apache2

Baculum Web with Lighttpd web server

apt-get install baculum-common baculum-web baculum-web-lighttpd

After installation please start the Lighttpd web server:

systemctl start baculum-web-lighttpd

CentOS/Fedora

Package repositories

Create a new repository file:

/etc/yum.repos.d/baculum.repo

and write one from the following repositories in it:

CentOS 7

[baculumrepo]
name=Baculum CentOS repository
baseurl=http://bacula.org/downloads/baculum/stable/centos
gpgcheck=1
gpgkey=http://bacula.org/downloads/baculum/baculum.pub
enabled=1

CentOS 8

[baculumrepo]
name=Baculum CentOS repository
baseurl=http://bacula.org/downloads/baculum/stable/centos8
gpgcheck=1
gpgkey=http://bacula.org/downloads/baculum/baculum.pub
enabled=1

Fedora 32

[baculumrepo]
name=Baculum Fedora repository
baseurl=http://bacula.org/downloads/baculum/stable/fedora32
gpgcheck=1
gpgkey=http://bacula.org/downloads/baculum/baculum.pub
enabled=1

Installation

The instalation consists of:

  • installing the Baculum Web,

  • installing the Baculum API.

Packages each of the Baculum components (Web and API) can be installed with one of the following web servers:

  • Apache,

  • Lighttpd.

Below you can find a list of all rpm packages with a brief description:

  • Common packages for the Baculum API and the Baculum Web:

    • baculum-common - Common files for the Baculum API and the Baculum Web.

  • The Baculum API packages:

    • baculum-api - main the Baculum API package with application files,

    • baculum-api-httpd - Apache web server configuration files for the Baculum API,

    • baculum-api-lighttpd - Lighttpd web server configuration files for the Baculum API,

    • baculum-api-selinux - SELinux policy module for the Baculum API.

  • The Baculum Web packages:

    • baculum-web - main the Baculum Web package with application files,

    • baculum-web-httpd - Apache web server configuration files for the Baculum Web,

    • baculum-web-lighttpd - Lighttpd web server configuration files for the Baculum Web,

    • baculum-web-selinux - SELinux policy module for the Baculum Web.

Baculum API

Baculum API with Apache web server

yum install baculum-common baculum-api baculum-api-httpd

Note

If you use SELinux, please also remember about installing the baculum-api-selinux package.

At the end please restart (or reload) the new Apache web server configuration:

systemctl restart httpd

Baculum API with Lighttpd web server

yum install baculum-common baculum-api baculum-api-lighttpd

Note

If you use SELinux, please also remember about installing the baculum-api-selinux package.

After installation please start the Lighttpd web server:

systemctl start baculum-api-lighttpd

SELinux support

If you have SELinux enabled in your operating system, you must also install the Baculum API SELinux package:

yum install baculum-api-selinux

Baculum Web

Baculum Web with Apache web server

yum install baculum-common baculum-web baculum-web-httpd

Note

If you use SELinux, please also remember about installing the baculum-web-selinux package.

At the end please restart (or reload) the new Apache web server configuration:

systemctl restart httpd

Baculum Web with Lighttpd web server

yum install baculum-common baculum-web baculum-web-lighttpd

Note

If you use SELinux, please also remember about installing the baculum-web-selinux package.

After installation please start the Lighttpd web server:

systemctl start baculum-web-lighttpd

SELinux support

If you have SELinux enabled on your operating system, you must also install the Baculum Web SELinux package:

yum install baculum-web-selinux

Manual installation

To manually install Baculum, you need to download the bacula-gui source archive from the Bacula project on SourceForge.net or directly from the download center at bacula.org.

Once you downloaded and extracted the bacula-gui archive, please go to the baculum directory:

cd bacula-gui-9.6.6/baculum/

In the installation process an assumed path for the web server document root directory is /var/www/baculum/. You can change this path by modifying value of the WWWDIR parameter.

The installation examples below are for the Apache web server, but with small modifications they can be easily used for other web browsers.

RPM-based Linux distributions

Prepare the build files:

make build DESTDIR=/tmp/baculum-files WWWDIR=/var/www/baculum

The /tmp/baculum-files directory contains the Baculum API and the Baculum Web files ready to be copied into destination locations on the operating system.

Now you need to install the Baculum API and the Baculum Web dependencies:

yum install httpd php php-common php-pdo php-mysqlnd php-pgsql php-bcmath php-json php-xml php-ldap

and copy the web type files to the web pages directory:

cp -R /tmp/baculum-files/var/www/baculum/ /var/www

Copy the Apache web server configuration files:

cp /tmp/baculum-files/etc/httpd/conf.d/baculum-*conf /etc/httpd/conf.d/

Copy the basic authentication files:

cp /tmp/baculum-files/etc/baculum/Config-api-apache/baculum.users /var/www/baculum/protected/API/Config
cp /tmp/baculum-files/etc/baculum/Config-web-apache/baculum.users /var/www/baculum/protected/Web/Config

Copy the localization files:

cp --remove-destination /tmp/baculum-files/usr/share/locale/en/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/en/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pl/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/pl/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pt/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/pt/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/en/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/en/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pl/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/pl/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pt/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/pt/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/ja/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/ja/messages.mo

Set ownership of copied files:

chown -R apache:apache /var/www/baculum

If in your operating system you are using SELinux, please use commands below:

yum install selinux-policy-devel
make -C examples/selinux/ -f /usr/share/selinux/devel/Makefile baculum-api.pp
make -C examples/selinux/ -f /usr/share/selinux/devel/Makefile baculum-web.pp
install -D -m 644 examples/selinux/baculum-api.pp /usr/share/selinux/packages/baculum-api/baculum-api.pp
install -D -m 644 examples/selinux/baculum-web.pp /usr/share/selinux/packages/baculum-web/baculum-web.pp
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/baculum/protected/API/Config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/baculum/protected/API/Logs(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/baculum/protected/Web/Config(/.*)?'
semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/baculum/protected/Web/Logs(/.*)?'
semanage fcontext -a -t httpd_cache_t '/var/www/baculum/assets(/.*)?'
semanage fcontext -a -t httpd_cache_t '/var/www/baculum/protected/runtime(/.*)?'
restorecon -i -R '/var/www/baculum/protected/API/Config' '/var/www/baculum/protected/API/Logs' '/var/www/baculum/protected/Web/Config' '/var/www/baculum/protected/Web/Logs' '/var/www/baculum/assets' '/var/www/baculum/protected/runtime'
semodule -i /usr/share/selinux/packages/baculum-api/baculum-api.pp
semodule -i /usr/share/selinux/packages/baculum-web/baculum-web.pp

Restart (or reload) the new Apache server new configuration:

systemctl restart httpd

DEB-based Linux distributions

Prepare the build files:

make build DESTDIR=/tmp/baculum-files SAMPLETYPE=deb-template HTTPDNAME=apache2 HTTPDSITECONF=sites-available WWWDIR=/var/www/baculum

The /tmp/baculum-files directory contains the Baculum API and the Baculum Web files ready to be copied into destination locations on the operating system.

Now you need to install the Baculum API and the Baculum Web dependencies:

apt-get install apache2 libapache2-mod-php php-bcmath php-cgi php-mysql php-pgsql php-json php-xml php-curl php-ldap

and copy the web type files to the web pages directory:

cp -R /tmp/baculum-files/var/www/baculum/ /var/www

Copy the Apache web server configuration files:

cp /tmp/baculum-files/etc/apache2/sites-available/baculum-*conf /etc/apache2/sites-available/

Copy the basic authentication files:

cp /tmp/baculum-files/etc/baculum/Config-api-apache/baculum.users /var/www/baculum/protected/API/Config
cp /tmp/baculum-files/etc/baculum/Config-web-apache/baculum.users /var/www/baculum/protected/Web/Config

Copy the localization files:

cp --remove-destination /tmp/baculum-files/usr/share/locale/en/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/en/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pl/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/pl/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pt/LC_MESSAGES/baculum-api.mo /var/www/baculum/protected/API/Lang/pt/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/en/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/en/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pl/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/pl/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/pt/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/pt/messages.mo
cp --remove-destination /tmp/baculum-files/usr/share/locale/ja/LC_MESSAGES/baculum-web.mo /var/www/baculum/protected/Web/Lang/ja/messages.mo

Set ownership of copied files:

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

Enable the baculum-api and baculum-web virtual host sites:

a2ensite baculum-api
a2ensite baculum-web

Enable the rewrite Apache module:

a2enmod rewrite

Restart (or reload) the new Apache web server configuration:

systemctl restart apache2

Checking manual installation

The build files contain a script that verifies the correctness of the manual installation. It checks ownership and permissions of the installed files.

Checking installation if the Apache web server is used:

/tmp/baculum-files/baculum-install-checker.sh -a

Checking installation if the Lighttpd web server is used:

/tmp/baculum-files/baculum-install-checker.sh -l