4 \chapter{Baculum Web GUI Tool}
7 This chapter presents the Bacula Web based interface that has been added to
8 the Bacula project for version 7.0 and later.
10 \section{Base Features}
12 Baculum provides the following base features:
15 \item Running Bacula jobs (backup, restore, verify...).
16 \item Monitoring Bacula service status.
17 \item Bacula console available via a Web window.
18 \item Multi-user interface.
19 \item Support for customized and restricted consoles (Console ACL function).
20 \item Volume management.
21 \item User friendly graphs and metrics.
22 \item Basic storage daemon operations (mount, umount, release, ...).
23 \item Easy to use configuration and restore wizards.
24 \item Multiple Director support.
25 \item Live AJAX based statuses.
28 \section{General Requirements}
30 Environment for Baculum installation should have following components
34 \item A Web Server - with mod\_rewrite module loaded. Baculum has been
35 tested with Apache, Nginx and Lighttpd web servers.
36 \item PHP 5.3 or higher with following modules installed:
38 \item PDO PHP support - depending on your catalog database: PDO PostgreSQL
39 or PDO MySQL. Note, in case using MySQL database there is required to use MySQL
40 native driver. It is php-mysqlnd for PHP, not php-mysql.
41 \item BCMath PHP module.
42 \item cURL PHP module.
43 \item MB String PHP module.
44 \item JSON PHP module.
46 \item A working Bacula bconsole - configured Bacula text based console
47 \item Direct access to the Bacula Catalog database (local or remote)
50 All the above requirements are validated during Baculum start. If
51 an error is found you will be notified during the initial login.
52 See below for instructions on how to correct errors.
54 With installation from binary packages (deb, rpm) all requirements
55 will be automatically installed as packages dependencies.
57 \section{Installation from rpm binary packages}
59 For rpm binary there are the following packages:
62 \item baculum - main package with application files
63 \item baculum-selinux - SELinux policies module
64 \item baculum-httpd - Apache web server configuration files
65 \item baculum-lighttpd - Lighttpd web server configuration files
68 You must install at a minimum the {\bf baculum} package and either
69 baculum-http or {\bf baculum-lighttpd}.
71 \subsection{Add the Bacula rpm repository}
73 To add the Baculum repository, first you must import the Baculum public key:
76 rpm --import http://bacula.org/downloads/baculum/baculum.pub
79 Once the key is imported, the next step is to add the repository
80 definition. First you must create the following file:
83 /etc/yum.repos.d/baculum.repo
86 The for CentOS 7, put the following in the file just created:
90 name=Baculum CentOS repository
91 baseurl=http://bacula.org/downloads/baculum/centos
96 For Fedora 23 the {\bf bacula.repo} file should have the following contents:
100 name=Baculum Fedora repository
101 baseurl=http://bacula.org/downloads/baculum/fedora
106 \subsection{Installation for the Apache Web server}
108 Install Baculum for the Apache Web server as follows:
111 yum install baculum baculum-httpd
114 Restart your Apache Web server:
117 service httpd restart
120 \subsection{Access to bconsole via sudo}
122 Baculum requires access to Bconsole. To configure Bconsole sudo access there
123 can use following entries in newly created Baculum sudoers.d file (usually in
124 path /etc/sudoers.d/baculum):
126 In case default user both for Apache and Lighttpd:
129 Defaults:web-user !requiretty
130 web-user ALL=NOPASSWD: /usr/sbin/bconsole
133 Where {\bf web-user} must be replaced by the Linux
134 username under which your Web server is running.
136 For example, on Fedora the default Apache server name is {\bf apache};
137 on Debian/Ubuntu it is {\bf www-data}, and on CentOS/RedHat it
138 is {\bf apache} or {\bf apache2}.
140 \subsection{Running Baculum for the First Time}
141 Access Baculum from a Web browser: \textbf{http://localhost:9095}
143 First time login: \textbf{admin}
145 First time password: \textbf{admin}
147 \subsection{Debugging your First Login}
148 At each step of the initial login to Baculum, the
149 screen will have a test button that will allow you
150 to check to see if your parameters were correctly
151 entered. If not, you can get additional detail by
152 examining the Apache error log, that is usually
156 /var/log/apache2/error.log
159 In addition, special debug output is placed by Baculum in
163 /etc/baculum/Data-apache/baculum.dbg
166 With the information in those two files, you can usually quickly
167 find and correct most problems.
170 \subsection{Installation for Lighttpd}
172 Installation on system with SELinux enabled access and access via
173 Lighttpd is as follows
176 yum install baculum baculum-selinux baculum-lighttpd
179 You can skip installing baculum-selinux if you do not use SELinux.
181 Please note that in case CentOS distribution the Lighttpd web server is
182 available in the distribution packages after enabling the EPEL repository.
184 Start Baculum as application using the lighttpd Web server:
187 service baculum-lighttpd start
191 \subsection{Access to bconsole via sudo}
193 Baculum requires access to Bconsole. To configure Bconsole sudo access
194 we strongly recommend that you create a Baculum sudoers.d file, which
195 should be in /etc/sudoers.d/baculum:
197 In case default Apache user, the file contents must be:
200 Defaults:apache !requiretty
201 apache ALL=NOPASSWD: /usr/sbin/bconsole
204 In case default Lighttpd user the file contents must be:
207 Defaults:lighttpd !requiretty
208 lighttpd ALL=NOPASSWD: /usr/sbin/bconsole
211 \subsection{Running Baculum for the First Time with Lighttpd}
212 Access Baculum from your Web browser: \textbf{http://localhost:9095}
214 First time login: \textbf{admin}
216 First time password: \textbf{admin}
218 \section{Installation from deb binary packages}
220 For deb binary packages format you will find the following packages:
223 \item baculum - main package with application files
224 \item baculum-apache2 - Apache web server configuration files
225 \item baculum-lighttpd - Lighttpd web server configuration files
228 \subsection{Add deb repository}
230 To add the Baculum repository, first import the Baculum public key:
233 wget -qO - http://bacula.org/downloads/baculum/baculum.pub | apt-key add -
236 Once the key is imported, the next step is to create
240 /etc/apt/sources.list.d/baculum.list
243 For Debian 8 Jessie the contents should be:
246 deb http://bacula.org/downloads/baculum/debian jessie main
247 deb-src http://bacula.org/downloads/baculum/debian jessie main
250 For Ubuntu 15.04 Vivid the contents should be:
252 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu vivid main
253 deb-src http://bacula.org/downloads/baculum/ubuntu vivid main
256 For Ubuntu 15.10 Wily the contents should be:
258 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu wily main
259 deb-src http://bacula.org/downloads/baculum/ubuntu wily main
262 After adding repository definition, please refresh repository indexes:
267 \subsection{Installation for Apache}
269 To install Baculum access via Apache Web server by using apt
270 packages manager use the command:
273 apt-get install baculum baculum-apache2
276 Next you must enable mod\_rewrite module for Apache, with the
280 ln -s /etc/apache2/mods-available/rewrite.load \
281 /etc/apache2/mods-enabled/rewrite.load
284 and include Baculum VirtualHost definition in the Apache configuration
288 ln -s /etc/apache2/sites-available/baculum.conf \
289 /etc/apache2/sites-enabled/baculum.conf
292 The restart your Apache server with:
295 service apache2 restart
298 and access Baculum from you Web browser with: \textbf{http://localhost:9095}
300 First time login: \textbf{admin}
302 First time password: \textbf{admin}
304 \subsection{Installation for Lighttpd}
306 Example installation with access via Lighttpd web server looks following:
309 apt-get install baculum baculum-lighttpd
312 Start Baculum as application available through Apache web server:
315 service baculum-lighttpd start
318 Access from web browser: \textbf{http://localhost:9095}
320 First time login: \textbf{admin}
322 First time password: \textbf{admin}
325 \section{Installation from the Source Tar File}
327 You may also install Baculum from the source bacula-gui tar archive.
329 To prepare Baculum runtime files one uses the Makefile file.
330 To do this, after unpacking bacula-gui archive please go to Baculum main
337 Then please run (depending on used distribution):
339 For rpm-based distributions (example with /tmp/baculum-runtime destination directory):
342 make build DESTDIR=/tmp/baculum-runtime
345 For deb-based distributions (example with /tmp/baculum-runtime destination directory):
348 make build DESTDIR=/tmp/baculum-release SAMPLETYPE=deb-template \
349 HTTPDNAME=apache2 HTTPDSITECONF=sites-available
352 After execution above command, in path /tmp/baculum-runtime should
353 contain all required runtime files.
355 The Base Baculum source files will be located in:
358 /tmp/baculum-runtime/usr/share/baculum/htdocs/
361 These are the files that should be placed in web server's document root (or
362 Virtual Host document root) directory.
364 Please note that for language files (including English)
365 symbolic links must be created as shown below:
368 /usr/share/locale/en/LC_MESSAGES/baculum.mo
369 => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/en/baculum.mo
371 /usr/share/locale/pl/LC_MESSAGES/baculum.mo
372 => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pl/baculum.mo
374 /usr/share/locale/pt/LC_MESSAGES/baculum.mo
375 => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pt/baculum.mo
378 Please also update the symbolic link to the Baculum settings directory in
382 /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Data
385 Other files are: web servers configuration files, systemd units, SELinux
386 policy module and others. Please select and copy appropriate files to your
387 system environment and edit their content if needed.
389 You must set read/write privileges for the Web server user
390 to the files and directories listed below:
394 ./baculum/protected/Data/
395 ./baculum/protected/Data/baculum.users
396 ./baculum/protected/runtime/
400 \section{Users and Restricted Consoles}
402 Baculum supports customized and restricted consoles for each logged in user.
404 General design permits one administrator and many users. For each
405 user it is possible to define a unique bconsole configuration file that will
406 allow the user access to specific resources only.
408 Resources limitation is realized by using Bacula Restricted Consoles
411 Before using customized and restricted consoles with Baculum please check
412 the location for bconsole configuration files for each user. To do so,
413 please run the configuration wizard and then to go to "Console" wizard step
416 In the "Console" wizard step there is a field "Bconsole custom config file
417 path". In this field you must define a location for restricted
418 consoles. In the defined path exists keyword \textbf{\{user\}}.
419 During login, Baculum will replace this keyword with the logged in
420 username. This permits using a single directory which contains
421 a different bconsole-xxx.conf for each user (where xxx is replaced by the
424 For example, if there the user named "john", is logging in, Baculum
425 will replace the keyword \{user\} with {\bf john}.
429 "Bconsole custom config file path" is defined as:
432 /usr/local/bacula/etc/bconsole-{user}.conf
435 Thus for user "john", Baculum will use the following file for
436 each access to bconsole:
439 /usr/local/bacula/etc/bconsole-john.conf
442 The permits defining user specific Console access (or restricted
443 access) for each Baculum user.
445 Note that it is possible to create users and which bconsole file
446 will be accessed using Baculum, but it is not currently possible
447 to use Baculum to create the bconsole configuration files.
448 For this reason please prepare
449 bconsole configuration files for each regular (non-administrator) user
450 and check the access by logging in to Baculum as the new user.
452 For Baculum to work work correctly some Bconsole commands are necessary.
466 \item .bvfs\_versions
467 \item .bvfs\_get\_jobids
472 Example configuration of the Restricted Console can look like below:
476 Name = "BaculaRestrictedUser"
477 Password = "XXXXXXXXX"
478 CommandACL = run,show,.client,.jobs,.fileset,.pool,.storage,.jobs,.bvfs_update,
479 .bvfs_lsdirs,.bvfs_lsfiles,.bvfs_versions,.bvfs_get_jobids,.bvfs_restore,restore
482 JobACL = somejob1,userjob
485 FileSetACL = somejob1-fileset,userjobFileSet3
490 \section{Screenshots}
492 \includegraphics{baculum01.png}
494 \includegraphics{baculum02.png}
496 \includegraphics{baculum03.png}
498 \includegraphics{baculum04.png}
500 \includegraphics{baculum05.png}
502 \includegraphics{baculum06.png}