Installing webacula on Fedora core 20

This guide is for Fedora core 20 only.

The start of course is the “yum -y install webacula”. Do that first.

That will amongst other things place an install guide /usr/share/doc/webacula/docs/INSTALL, I skimmed it to find the minimum steps needed to get this working. Not all the changes required were in the INSTALL file anyway.

This post is the steps I needed to take to get it installed on my bacula server.

(1) Create the databases

The database tables needed to be manually created. Thats perfectly normal for any package and that step worked well.

Edit the supplied scripts to create the database and tables and run them, no problems there.

/usr/share/webacula/install/webacula_mysql_create_database.sh
/usr/share/webacula/install/webacula_mysql_make_tables.sh

Also while fiddling around in there this is a good time to update the bacula database-name/user/password to whatever is used by your bacula databse; thats in the file below

/usr/share/webacula/application/config.ini

After the tables were created and the config file updated it should all just work right.
Wrong. I had to go through the additional steps below

(2) update apache config to allow access

The first issue was I could not browse to the application URL.

In the installed /etc/httpd/conf.d/webacula.conf file the following lines were commented. So the global apache settings did not permit access to the application.

#   AuthType Basic
#   AuthName "Webacula"
#   AuthUserFile       /etc/httpd/conf/webacula.users
#   Require valid-user

I added below those four lines

    Require all granted

On a production site you might want to instead uncomment the lines and create a htpasswd file for the AuthUserFile to use.
However for a home network you will also notice in that file it denies access from all servers except localhost. I just added my two desktop servers to the allow list which is enough to control local access.

(3) Install mysql Zend driver

The next issue was the PDO driver for mysql was not installed. As determined by the fortunately verbose error message in the apache error_log file

[Sun Jun 29 11:17:32.852494 2014] [:error] [pid 11092] [client 192.168.1.187:1905] PHP Fatal error:  Uncaught exception 'Zend_Exception' with message 'File "Zend/Db/Adapter/Pdo/Mysql.php" does not exist or class "Zend_Db_Adapter_Pdo_Mysql" was not found in the file' in /usr/share/php/Zend/Loader.php:87\nStack trace:\n#0 /usr/share/php/Zend/Db.php(263): Zend_Loader::loadClass('Zend_Db_Adapter...')\n#1 /usr/share/webacula/html/index.php(103): Zend_Db::factory('PDO_MYSQL', Array)\n#2 {main}\n  thrown in /usr/share/php/Zend/Loader.php on line 87

That had to be manually installed.

yum -y install php-ZendFramework-Db-Adapter-Pdo-Mysql

(4) The repo version of webacula is out of date

The next issue was the repo version of webacula was for a much earlier version of bacula, the repo files are not compatible with each other. A very clear error message in the apache error_log file.

[Sun Jun 29 11:31:14.940417 2014] [:error] [pid 11092] [client 192.168.1.187:1942] PHP Fatal error:  Uncaught exception 'Zend_Exception' with message 'Version error for Catalog database (wanted 12, got 14) ' in /usr/share/webacula/html/index.php:183\nStack trace:\n#0 {main}\n  thrown in /usr/share/webacula/html/index.php on line 183

Both bacula and webacula were installed from the Fedora repositories. An update showed I have the latest webacula; so the repository versions are out of step.
[root@vmhost1 application]# yum update webacula
Loaded plugins: langpacks, refresh-packagekit
No packages marked for update

Definately a risk as obviously the underlying bacula tables are a much later version, but I manually changed the hard coded version the script expected to the version number in the bacula database.
In file /usr/share/webacula/html/index.php I changed the below to get past that error.

define('BACULA_VERSION', 14); // Bacula Catalog version *MID CHANGE FROM 12 TO 14

(5) Setup SUDO access for bconsole

The final change needed is that by default when installed webacula wants to use sudo to access bconsole; so “visudo” and add at the end of the file

# for webacula
Defaults:apache !requiretty
%apache localhost=NOPASSWD: /sbin/bconsole
%apache realhostname=NOPASSWD: /sbin/bconsole

An important note on the above; on my server the localhost entry did not work even though the http server is listening on all interfaces, which is why I added the second %apache entry, change realhostname to the real host name of the server you are installing webacula on.

(6) Try it, it should work now

Restart the https server to pick up the changes you have been making. Then point your browser at the /webacula URL you configured. All done.

Summary

For me the bad news is I have been trying to remember what web interface I used to use to manage my bacula server; and installing various packages to find the functionality I want. This was not it unfortunately.

The restore functionality of webacula is pretty impressive so I won’t be un-installing it just yet, as I’ve made a few typos on command line restores before. But I doubt I will use it for anything else.

So back to the bconsole command line for me.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.