How To Install Bacula-Web on Ubuntu 14.04

Introduction

Bacula-Web is a PHP web application that provides an easy way to view summaries and graphs of Bacula backup jobs that have already run. Although it doesn't allow you to control Bacula in any way, Bacula-Web provides a graphical alternative to viewing jobs from the console. Bacula-Web is especially useful for users who are new to Bacula, as its reports make it easy to understand what Bacula has been operating.

In this tutorial, we will show you how to install Bacula-Web on an Ubuntu 14.04 server that your Bacula server software is running on.

Prerequisites

This tutorial assumes that your Bacula setup is using MySQL for the catalog. If you are using a different RDBMS, such as PostgreSQL, be sure to make the proper adjustments to this tutorial. You will need to install the appropriate PHP module(s) and make adjustments to the database connection information examples.

Let's get started.

Install Nginx and PHP

Bacula-Web is a PHP application, so we need to install PHP and a web server. We'll use Nginx. If you want to learn more about this particular software setup, check out this LEMP tutorial.

Update your apt-get listings:

sudo apt-get update

Then, install Nginx, PHP-fpm, and a few other packages with apt-get:

sudo apt-get install nginx apache2-utils php5-fpm php5-mysql php5-gd

Now we are ready to configure PHP and Nginx.

Configure PHP-FPM

Open the PHP-FPM configuration file in your favorite text editor. We'll use vi:

sudo vi /etc/php5/fpm/php.ini

Find the line that specifies cgi.fix_pathinfo, uncomment it, and replace its value with 0. It should look like this when you're done.

cgi.fix_pathinfo=0

Now find the date.timezone setting, uncomment it, and replace its value with your time zone. We're in New York, so that's what we're setting the value to:

PHP-FPM is configured properly, so let's restart it to put the changes into effect:

sudo service php5-fpm restart

Configure Nginx

Now it's time to configure Nginx to serve PHP applications.

First, because we don't want unauthorized people to access Bacula-Web, let's create an htpasswd file. Use htpasswd to create an admin user, called "admin" (you should use another name), that can access the Bacula-Web interface:

sudo htpasswd -c /etc/nginx/htpasswd.users admin

Enter a password at the prompt. Remember this login, as you will need it to access Bacula-Web.

Now open the Nginx default server block configuration file in a text editor. We'll use vi:

sudo vi /etc/nginx/sites-available/default

Replace the contents of the file with the following code block. Be sure to substitute the highlighted value of server_name with your server's domain name or IP address:

Now create a new directory, bacula-web, change to it, and extract the Bacula-Web archive:

mkdir bacula-web
cd bacula-web
tar xvf ../bacula-web-*.tgz

Before copying the files to our web server's document root, we should configure it first.

Change to the configuration directory like this:

cd application/config

Bacula-Web provides a sample configuration. Copy it like this:

cp config.php.sample config.php

Now edit the configuration file in a text editor. We'll use vi:

vi config.php

Find the // MySQL bacula catalog, and uncomment the connection details. Also, replace the password value with your Bacula database password (which can be found in /etc/bacula/bacula-dir.conf in the "dbpassword" setting):

Bacula-Web is now configured. The last step is to put the application files in the proper place.

Copy Bacula-Web Application to Document Root

We configured Nginx to use /usr/share/nginx/html as the document root. Change to it, and delete the default index.html, with these commands:

cd /usr/share/nginx/html
sudo rm index.html

Now, move the Bacula-Web files to your current location, the Nginx document root:

sudo mv ~/bacula-web/* .

Change the ownership of the files to www-data, the daemon user that runs Nginx:

sudo chown -R www-data: *

Now Bacula-Web is fully installed.

Access Bacula-Web via a Browser

Bacula-Web is now accessible on your server's domain name or public IP address.

You may want to test that everything is configured properly. Luckily, a Bacula-Web test page is provided. Access it by opening this URL in a web browser (substitute the highlighted part with your server's information):

http://server_public_IP/test.php

You should see a table that shows the status of the various components of Bacula-Web. They should all have a green checkmark status, except for the database modules that you don't need. For example, we're using MySQL, so we don't need the other database modules:

If everything looks good, you're ready to use the dashboard. You can access it by clicking on the top-left "Bacula-Web" text, or by visiting your server in a web browser:

http://server_public_IP/

It should look something like this:

Conclusion

Now you are ready to use Bacula-Web to easily monitor your various Bacula jobs and statuses.

This series will show you how implement file backups of your Ubuntu 14.04 servers using Bacula, the popular open-source backup software suite.

April 9, 2015

Bacula is an open-source network backup solution that allows you create backups and perform data recovery of your computer systems. In this tutorial, we will show you how to install and configure the server components of Bacula on an Ubuntu 14.04 server.

April 10, 2015

This tutorial will show you how to set up Bacula to create backups of a remote Ubuntu 14.04 host over a network connection. This involves installing and configuring the Bacula Client software on a remote host, and making some additions to the configuration of an existing Bacula Server.

April 3, 2015

Bacula-Web is a PHP web application that provides an easy way to view summaries and graphs of completed Bacula jobs. Although it doesn't allow you to control Bacula in any way, Bacula-Web provides a graphical alternative to viewing jobs from the console. In this tutorial, we will show you how to install Bacula-Web on an Ubuntu 14.04 server that has Bacula software already installed.

April 21, 2015

This tutorial will show you how to perform a full hot backup of your MySQL or MariaDB databases using Percona XtraBackup on Ubuntu 14.04. The resulting database backup can then be copied to a remote server with a traditional file backup system, like Bacula. The process of restoring the database from a backup is also covered.