]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/console/baculum.tex
e4a87c6fe892d8a57cb4067e6b8327c3ea17242d
[bacula/docs] / docs / manuals / en / console / baculum.tex
1 %%
2 %%
3
4 \chapter{Baculum Web GUI Tool}
5 \label{BaculumChapter}
6
7 This chapter presents the Bacula Web based interface that has been added to
8 the Bacula project for version 7.0 and later.
9
10 \section{Base Features}
11
12 Baculum provides the following base features:
13
14 \begin{itemize}
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.
26 \end{itemize}
27
28 \section{General Requirements}
29
30 Environment for Baculum installation should have following components
31 installed:
32
33 \begin{itemize}
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:
37  \begin{itemize}
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.
45  \end{itemize}
46 \item A working Bacula bconsole - configured Bacula text based console
47 \item Direct access to the Bacula Catalog database (local or remote)
48 \end{itemize}
49
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.
53
54 With installation from binary packages (deb, rpm) all requirements 
55 will be automatically installed as packages dependencies.
56
57 \section{Installation from rpm binary packages}
58
59 For rpm binary there are the following packages:
60
61 \begin{itemize}
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
66 \end{itemize}
67
68 You must install at a minimum the {\bf baculum} package and either
69 baculum-http or {\bf baculum-lighttpd}.
70
71 \subsection{Add the Bacula rpm repository}
72
73 To add the Baculum repository, first you must import the Baculum public key:
74
75 \begin{verbatim}
76 rpm --import http://bacula.org/downloads/baculum/baculum.pub
77 \end{verbatim}
78
79 Once the key is imported, the next step is to add the repository
80 definition.  First you must create the following file:
81
82 \begin{verbatim}
83 /etc/yum.repos.d/baculum.repo
84 \end{verbatim}
85
86 The for CentOS 7, put the following in the file just created:
87
88 \begin{verbatim}
89 [baculumrepo]
90 name=Baculum CentOS repository
91 baseurl=http://bacula.org/downloads/baculum/centos
92 gpgcheck=1
93 enabled=1
94 \end{verbatim}
95
96 For Fedora 23 the {\bf bacula.repo} file should have the following contents:
97
98 \begin{verbatim}
99 [baculumrepo]
100 name=Baculum Fedora repository
101 baseurl=http://bacula.org/downloads/baculum/fedora
102 gpgcheck=1
103 enabled=1
104 \end{verbatim}
105
106 \subsection{Installation for the Apache Web server}
107
108 Install Baculum for the Apache Web server as follows:
109
110 \begin{verbatim}
111 yum install baculum baculum-httpd
112 \end{verbatim}
113
114 Restart your Apache Web server:
115
116 \begin{verbatim}
117 service httpd restart
118 \end{verbatim}
119
120 \subsection{Access to bconsole via sudo}
121
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):
125
126 In case default user both for Apache and Lighttpd:
127
128 \begin{verbatim}
129 Defaults:web-user !requiretty
130 web-user  ALL=NOPASSWD:  /usr/sbin/bconsole
131 \end{verbatim}
132
133 Where  {\bf web-user} must be replaced by the Linux
134 username under which your Web server is running.
135
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}.
139
140 \subsection{Running Baculum for the First Time}
141 Access Baculum from a Web browser: \textbf{http://localhost:9095}
142
143 First time login: \textbf{admin}
144
145 First time password: \textbf{admin}
146
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 
153 found at:
154
155 \begin{verbatim}
156 /var/log/apache2/error.log
157 \end{verbatim}
158
159 In addition, special debug output is placed by Baculum in
160 the file:
161
162 \begin{verbatim}
163 /etc/baculum/Data-apache/baculum.dbg
164 \end{verbatim}
165
166 With the information in those two files, you can usually quickly
167 find and correct most problems.
168
169
170 \subsection{Installation for Lighttpd}
171
172 Installation on system with SELinux enabled access and access via
173 Lighttpd is as follows
174
175 \begin{verbatim}
176 yum install baculum baculum-selinux baculum-lighttpd
177 \end{verbatim}
178
179 You can skip installing baculum-selinux if you do not use SELinux.
180
181 Please note that in case CentOS distribution the Lighttpd web server is
182 available in the distribution packages after enabling the EPEL repository.
183
184 Start Baculum as application using the lighttpd Web server:
185
186 \begin{verbatim}
187 service baculum-lighttpd start
188 \end{verbatim}
189
190
191 \subsection{Access to bconsole via sudo}
192
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:
196
197 In case default Apache user, the file contents must be:
198
199 \begin{verbatim}
200 Defaults:apache !requiretty
201 apache  ALL=NOPASSWD:  /usr/sbin/bconsole
202 \end{verbatim}
203
204 In case default Lighttpd user the file contents must be:
205
206 \begin{verbatim}
207 Defaults:lighttpd !requiretty
208 lighttpd  ALL=NOPASSWD:  /usr/sbin/bconsole
209 \end{verbatim}
210
211 \subsection{Running Baculum for the First Time with Lighttpd}
212 Access Baculum from your Web browser: \textbf{http://localhost:9095}
213
214 First time login: \textbf{admin}
215
216 First time password: \textbf{admin}
217
218 \section{Installation from deb binary packages}
219
220 For deb binary packages format you will find the following packages:
221
222 \begin{itemize}
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
226 \end{itemize}
227
228 \subsection{Add deb repository}
229
230 To add the Baculum repository, first import the Baculum public key:
231
232 \begin{verbatim}
233 wget -qO - http://bacula.org/downloads/baculum/baculum.pub | apt-key add -
234 \end{verbatim}
235
236 Once the key is imported, the next step is to create
237 a new baculum file:
238
239 \begin{verbatim}
240 /etc/apt/sources.list.d/baculum.list
241 \end{verbatim}
242
243 For Debian 8 Jessie the contents should be:
244
245 \begin{verbatim}
246 deb http://bacula.org/downloads/baculum/debian jessie main
247 deb-src http://bacula.org/downloads/baculum/debian jessie main
248 \end{verbatim}
249
250 For Ubuntu 15.04 Vivid the contents should be:
251 \begin{verbatim}
252 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu vivid main
253 deb-src http://bacula.org/downloads/baculum/ubuntu vivid main
254 \end{verbatim}
255
256 For Ubuntu 15.10 Wily the contents should be:
257 \begin{verbatim}
258 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu wily main
259 deb-src http://bacula.org/downloads/baculum/ubuntu wily main
260 \end{verbatim}
261
262 After adding repository definition, please refresh repository indexes:
263 \begin{verbatim}
264 apt-get update
265 \end{verbatim}
266
267 \subsection{Installation for Apache}
268
269 To install Baculum access via Apache Web server by using apt
270 packages manager use the command:
271
272 \begin{verbatim}
273 apt-get install baculum baculum-apache2
274 \end{verbatim}
275
276 Next you must enable mod\_rewrite module for Apache, with the
277 following command:
278
279 \begin{verbatim}
280 ln -s /etc/apache2/mods-available/rewrite.load \
281     /etc/apache2/mods-enabled/rewrite.load
282 \end{verbatim}
283
284 and include Baculum VirtualHost definition in the Apache configuration
285 with:
286
287 \begin{verbatim}
288 ln -s /etc/apache2/sites-available/baculum.conf \
289     /etc/apache2/sites-enabled/baculum.conf
290 \end{verbatim}
291
292 The restart your Apache server with:
293
294 \begin{verbatim}
295 service apache2 restart
296 \end{verbatim}
297
298 and access Baculum  from you Web browser with: \textbf{http://localhost:9095}
299
300 First time login: \textbf{admin}
301
302 First time password: \textbf{admin}
303
304 \subsection{Installation for Lighttpd}
305
306 Example installation with access via Lighttpd web server looks following:
307
308 \begin{verbatim}
309 apt-get install baculum baculum-lighttpd
310 \end{verbatim}
311
312 Start Baculum as application available through Apache web server:
313
314 \begin{verbatim}
315 service baculum-lighttpd start
316 \end{verbatim}
317
318 Access from web browser: \textbf{http://localhost:9095}
319
320 First time login: \textbf{admin}
321
322 First time password: \textbf{admin}
323
324
325 \section{Installation from the Source Tar File}
326
327 You may also install Baculum from the source bacula-gui tar archive.
328
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
331 directory:
332
333 \begin{verbatim}
334 cd ./web/baculum/
335 \end{verbatim}
336
337 Then please run (depending on used distribution):
338
339 For rpm-based distributions (example with /tmp/baculum-runtime destination directory):
340
341 \begin{verbatim}
342 make build DESTDIR=/tmp/baculum-runtime
343 \end{verbatim}
344
345 For deb-based distributions (example with /tmp/baculum-runtime destination directory):
346
347 \begin{verbatim}
348 make build DESTDIR=/tmp/baculum-release SAMPLETYPE=deb-template \
349 HTTPDNAME=apache2 HTTPDSITECONF=sites-available
350 \end{verbatim}
351
352 After execution above command, in path /tmp/baculum-runtime should
353 contain all required runtime files.
354
355 The Base Baculum source files will be located in:
356
357 \begin{verbatim}
358 /tmp/baculum-runtime/usr/share/baculum/htdocs/
359 \end{verbatim}
360
361 These are the files that should be placed in web server's document root (or
362 Virtual Host document root) directory.
363
364 Please note that for language files (including English)
365 symbolic links must be created as shown below:
366
367 \begin{verbatim}
368 /usr/share/locale/en/LC_MESSAGES/baculum.mo
369  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/en/baculum.mo
370
371 /usr/share/locale/pl/LC_MESSAGES/baculum.mo
372  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pl/baculum.mo
373
374 /usr/share/locale/pt/LC_MESSAGES/baculum.mo
375  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pt/baculum.mo
376 \end{verbatim}
377
378 Please also update the symbolic link to the Baculum settings directory in
379 the following path:
380
381 \begin{verbatim}
382 /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Data
383 \end{verbatim}
384
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.
388
389 You must set read/write privileges for the Web server user
390 to the files and directories listed below:
391
392 \begin{verbatim}
393 ./baculum/assets/
394 ./baculum/protected/Data/
395 ./baculum/protected/Data/baculum.users
396 ./baculum/protected/runtime/
397 \end{verbatim}
398
399
400 \section{Users and Restricted Consoles}
401
402 Baculum supports customized and restricted consoles for each logged in user.
403
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.
407
408 Resources limitation is realized by using Bacula Restricted Consoles
409 functionality.
410
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
414 (fourth step).
415
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
422 user login name.
423
424 For example, if there the user named "john", is logging in, Baculum 
425 will replace the keyword \{user\} with {\bf john}.
426
427 Example:
428
429 "Bconsole custom config file path" is defined as:
430
431 \begin{verbatim}
432 /usr/local/bacula/etc/bconsole-{user}.conf
433 \end{verbatim}
434
435 Thus for user "john", Baculum will use the following file for
436 each access to bconsole:
437
438 \begin{verbatim}
439 /usr/local/bacula/etc/bconsole-john.conf
440 \end{verbatim}
441
442 The permits defining user specific Console access (or restricted
443 access) for each Baculum user.
444
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.
451
452 For Baculum to work work correctly some Bconsole commands are necessary.
453 They are:
454
455 \begin{itemize}
456 \item show
457 \item .client
458 \item .jobs
459 \item .fileset
460 \item .pool
461 \item .storage
462 \item .jobs
463 \item .bvfs\_update
464 \item .bvfs\_lsdirs
465 \item .bvfs\_lsfiles
466 \item .bvfs\_versions
467 \item .bvfs\_get\_jobids
468 \item .bvfs\_restore
469 \item restore
470 \end{itemize}
471
472 Example configuration of the Restricted Console can look like below:
473
474 \begin{verbatim}
475 Console {
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
480     CatalogACL = *all*
481     ClientACL = user-fd
482     JobACL = somejob1,userjob
483     PoolACL = Full-Pool
484     StorageACL = VTL
485     FileSetACL = somejob1-fileset,userjobFileSet3
486     WhereACL = *all*
487 }
488 \end{verbatim}
489
490 \section{Screenshots}
491
492 \includegraphics{baculum01.png}
493
494 \includegraphics{baculum02.png}
495
496 \includegraphics{baculum03.png}
497
498 \includegraphics{baculum04.png}
499
500 \includegraphics{baculum05.png}
501
502 \includegraphics{baculum06.png}