]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/console/baculum.tex
d0cc33a60703c94a0b37d8422720b1d1867af09f
[bacula/docs] / docs / manuals / en / console / baculum.tex
1 %%
2 %%
3
4 \chapter{Baculum WebGUI Tool}
5 \label{BaculumChapter}
6
7 This chapter presents the new Bacula web based interface that has been added to
8 the Bacula projects in version 7.0 and later.
9
10 \section{Base Features}
11
12 Baculum provides following base features:
13
14 \begin{itemize}
15 \item Running Bacula jobs (backup, restore, verify...).
16 \item Monitoring Bacula services status.
17 \item Bacula console available via web interface.
18 \item Multi-users interface.
19 \item Support for customized and restricted consoles (Console ACL function).
20 \item Volumes management.
21 \item User friendly graphs and metrics.
22 \item Basic storage daemon operations (mount, umount, release actions).
23 \item Easy in use configuration and restore wizards.
24 \item Multiple Directors 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 installed:
31
32 \begin{itemize}
33 \item Web Server - with mod\_rewrite module loaded. Baculum has been tested with
34 Apache, Nginx and Lighttpd web servers.
35 \item PHP 5.3 or higher with following modules installed:
36  \begin{itemize}
37  \item PDO PHP support - depending on your catalog database: PDO PostgreSQL
38 or PDO MySQL. Note, in case using MySQL database there is required to use MySQL
39 native driver. It is php-mysqlnd for PHP, not php-mysql.
40  \item BCMath PHP module.
41  \item cURL PHP module.
42  \item MB String PHP module.
43  \item JSON PHP module.
44  \end{itemize}
45 \item Bconsole - configured Bacula text based console
46 \item Access to Bacula Catalog database (local or remote)
47 \end{itemize}
48
49 All above requirements are validated during Baculum start. If in installation
50 environment there occurs lack some from these components then you will be
51 informed about this fact.
52
53 In case installation from binary packages (deb, rpm) all requirements are
54 installed automatically as packages dependencies.
55
56 \section{Installation from rpm binary packages}
57
58 For rpm binary packages format there exist following packages:
59
60 \begin{itemize}
61 \item baculum - main package with application files
62 \item baculum-selinux - SELinux policies module
63 \item baculum-httpd - Apache web server configuration files
64 \item baculum-lighttpd - Lighttpd web server configuration files
65 \end{itemize}
66
67 \subsection{Add rpm repository}
68
69 To add Baculum repository, first is required importing public key:
70
71 \begin{verbatim}
72 rpm --import http://bacula.org/downloads/baculum/baculum.pub
73 \end{verbatim}
74
75 Once importing the key is done, next step is adding repository definition to
76 newly created file:
77
78 \begin{verbatim}
79 /etc/yum.repos.d/baculum.repo
80 \end{verbatim}
81
82 For CentOS 7 the definition is:
83
84 \begin{verbatim}
85 [baculumrepo]
86 name=Baculum CentOS repository
87 baseurl=http://bacula.org/downloads/baculum/centos
88 gpgcheck=1
89 enabled=1
90 \end{verbatim}
91
92 For Fedora 23 the definition is:
93
94 \begin{verbatim}
95 [baculumrepo]
96 name=Baculum Fedora repository
97 baseurl=http://bacula.org/downloads/baculum/fedora
98 gpgcheck=1
99 enabled=1
100 \end{verbatim}
101
102 \subsection{Installation for Apache}
103
104 Example installation for access via Apache web server can look like below:
105
106 \begin{verbatim}
107 yum install baculum baculum-httpd
108 \end{verbatim}
109
110 Start Baculum as application available through Apache web server:
111
112 \begin{verbatim}
113 service httpd restart
114 \end{verbatim}
115
116 Access from web browser: \textbf{http://localhost:9095}
117
118 First time login: \textbf{admin}
119
120 First time password: \textbf{admin}
121
122 \subsection{Installation for Lighttpd}
123
124 Example installation on system with SELinux enabled access and access via
125 Lighttpd looks following:
126
127 \begin{verbatim}
128 yum install baculum baculum-selinux baculum-lighttpd
129 \end{verbatim}
130
131 Please note that in case CentOS distribution the Lighttpd web server is
132 available in distribution packages after enabling EPEL repository.
133
134 Start Baculum as application available through Apache web server:
135
136 \begin{verbatim}
137 service baculum-lighttpd start
138 \end{verbatim}
139
140 Access from web browser: \textbf{http://localhost:9095}
141
142 First time login: \textbf{admin}
143
144 First time password: \textbf{admin}
145
146 \subsection{Access to bconsole via sudo}
147
148 Baculum requires access to Bconsole. To configure Bconsole sudo access there
149 can use following entries in newly created Baculum sudoers.d file (usually in
150 path /etc/sudoers.d/baculum):
151
152 In case default Apache user:
153
154 \begin{verbatim}
155 Defaults:apache !requiretty
156 apache  ALL= NOPASSWD:  /usr/sbin/bconsole
157 \end{verbatim}
158
159 In case default Lighttpd user:
160
161 \begin{verbatim}
162 Defaults:lighttpd !requiretty
163 lighttpd  ALL= NOPASSWD:  /usr/sbin/bconsole
164 \end{verbatim}
165
166 \section{Installation from deb binary packages}
167
168 For deb binary packages format there exist following packages:
169
170 \begin{itemize}
171 \item baculum - main package with application files
172 \item baculum-apache2 - Apache web server configuration files
173 \item baculum-lighttpd - Lighttpd web server configuration files
174 \end{itemize}
175
176 \subsection{Add deb repository}
177
178 To add Baculum repository, first is required importing public key:
179
180 \begin{verbatim}
181 wget -qO - http://bacula.org/downloads/baculum/baculum.pub | apt-key add -
182 \end{verbatim}
183
184 Once importing the key is done, next step is adding repository definition to
185 newly created file:
186
187 \begin{verbatim}
188 /etc/apt/sources.list.d/baculum.list
189 \end{verbatim}
190
191 For Debian 8 Jessie the definition is:
192
193 \begin{verbatim}
194 deb http://bacula.org/downloads/baculum/debian jessie main
195 deb-src http://bacula.org/downloads/baculum/debian jessie main
196 \end{verbatim}
197
198 For Ubuntu 15.04 Vivid the definition is:
199 \begin{verbatim}
200 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu vivid main
201 deb-src http://bacula.org/downloads/baculum/ubuntu vivid main
202 \end{verbatim}
203
204 For Ubuntu 15.10 Wily the definition is:
205 \begin{verbatim}
206 deb [ arch=amd64 ] http://bacula.org/downloads/baculum/ubuntu wily main
207 deb-src http://bacula.org/downloads/baculum/ubuntu wily main
208 \end{verbatim}
209
210 After adding repository definition please refresh repository indexes:
211 \begin{verbatim}
212 apt-get update
213 \end{verbatim}
214
215 \subsection{Installation for Apache}
216
217 Example installation for access via Apache web server by using apt packages
218 manager can look like below:
219
220 \begin{verbatim}
221 apt-get install baculum baculum-apache2
222 \end{verbatim}
223
224 Next is needed enable mod\_rewrite module for Apache:
225
226 \begin{verbatim}
227 ln -s /etc/apache2/mods-available/rewrite.load \
228     /etc/apache2/mods-enabled/rewrite.load
229 \end{verbatim}
230
231 and include Baculum VirtualHost definition into Apache configuration:
232
233 \begin{verbatim}
234 ln -s /etc/apache2/sites-available/baculum.conf \
235     /etc/apache2/sites-enabled/baculum.conf
236 \end{verbatim}
237
238 Start Baculum as application available through Apache web server:
239
240 \begin{verbatim}
241 service apache2 restart
242 \end{verbatim}
243
244 Access from web browser: \textbf{http://localhost:9095}
245
246 First time login: \textbf{admin}
247
248 First time password: \textbf{admin}
249
250 \subsection{Installation for Lighttpd}
251
252 Example installation with access via Lighttpd web server looks following:
253
254 \begin{verbatim}
255 apt-get install baculum baculum-lighttpd
256 \end{verbatim}
257
258 Start Baculum as application available through Apache web server:
259
260 \begin{verbatim}
261 service baculum-lighttpd start
262 \end{verbatim}
263
264 Access from web browser: \textbf{http://localhost:9095}
265
266 First time login: \textbf{admin}
267
268 First time password: \textbf{admin}
269
270 \subsection{Access to bconsole via sudo}
271
272 Baculum requires access to Bconsole. To configure Bconsole sudo access there
273 can use following entries in newly created Baculum sudoers.d file (usually in
274 path /etc/sudoers.d/baculum):
275
276 In case default user both for Apache and Lighttpd:
277
278 \begin{verbatim}
279 Defaults:www-data !requiretty
280 www-data  ALL= NOPASSWD:  /usr/sbin/bconsole
281 \end{verbatim}
282
283 \section{Installation from source tar archive}
284
285 There is possible to install Baculum from source bacula-gui tar archive.
286
287 To prepare Baculum runtime files there can be used Makefile file.
288 To do this, after unpacking bacula-gui archive please go to Baculum main
289 directory:
290
291 \begin{verbatim}
292 cd ./web/baculum/
293 \end{verbatim}
294
295 Then please run (depending on used distribution):
296
297 For rpm-based distributions (example with /tmp/baculum-runtime destination directory):
298
299 \begin{verbatim}
300 make build DESTDIR=/tmp/baculum-runtime
301 \end{verbatim}
302
303 For deb-based distributions (example with /tmp/baculum-runtime destination directory):
304
305 \begin{verbatim}
306 make build DESTDIR=/tmp/baculum-release SAMPLETYPE=deb-template \
307 HTTPDNAME=apache2 HTTPDSITECONF=sites-available
308 \end{verbatim}
309
310 After execution above command, in path /tmp/baculum-runtime should already exist all
311 runtime files.
312
313 Base Baculum source files will be located in:
314
315 \begin{verbatim}
316 /tmp/baculum-runtime/usr/share/baculum/htdocs/
317 \end{verbatim}
318
319 They are files that should be placed in web server's document root (or Virtual
320 Host document root) directory.
321
322 Please note that for language files (including English) are created symbolic
323 links as below:
324
325 \begin{verbatim}
326 /usr/share/locale/en/LC_MESSAGES/baculum.mo
327  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/en/baculum.mo
328
329 /usr/share/locale/pl/LC_MESSAGES/baculum.mo
330  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pl/baculum.mo
331
332 /usr/share/locale/pt/LC_MESSAGES/baculum.mo
333  => /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Lang/pt/baculum.mo
334 \end{verbatim}
335
336 Please also update symbolic link to Baculum settings directory in following
337 path:
338
339 \begin{verbatim}
340 /tmp/baculum-runtime/usr/share/baculum/htdocs/protected/Data
341 \end{verbatim}
342
343 Rest of files are: web servers configuration files, systemd units, SELinux
344 policy module and others. Please select and copy appropriate files to your
345 system environment and edit their content if needed.
346
347 At the end there is required to set read/write privileges for web server user
348 to listed below directories and files:
349
350 \begin{verbatim}
351 ./baculum/assets/
352 ./baculum/protected/Data/
353 ./baculum/protected/Data/baculum.users
354 ./baculum/protected/runtime/
355 \end{verbatim}
356
357
358 \section{Users and Restricted Consoles}
359
360 Baculum supports customized and restricted consoles for each logged in user.
361
362 General design allows to have one administrator and many users. For each
363 user there is possible to define own bconsole configuration file that will
364 allow the user to specific resources only.
365
366 Resources limitation is realized by Bacula Restricted Consoles functionality.
367
368 Before using customized and restricted consoles with Baculum please check
369 location for bconsole configuration files for each user. To do it, there
370 is need to run configuration wizard and then to go to "Console" wizard step
371 (fourth step).
372
373 In "Console" wizard step there is field "Bconsole custom config file path".
374 In this field there is required to define location for restricted consoles.
375 In defined path exists keyword \textbf{\{user\}}. The keyword will be replaced
376 into currently logged in username.
377
378 For example, if there is logged user named "john", keyword \{user\} will be
379 replaced into "john".
380
381 Example:
382
383 "Bconsole custom config file path" is defined as:
384
385 \begin{verbatim}
386 /usr/local/bacula/etc/bconsole-{user}.conf
387 \end{verbatim}
388
389 After login user "john" to Baculum webGUI, for each bconsole request will be
390 used file:
391
392 \begin{verbatim}
393 /usr/local/bacula/etc/bconsole-john.conf
394 \end{verbatim}
395
396 It makes available to define some specific Console access (or restricted
397 access) for each Baculum user.
398
399 Note that users are possible to create from Baculum web interface but bconsole
400 configuration files are not. From this reason please prepare bconsole
401 configuration files for each regular (not administrator) user self and check
402 access by logging in to Baculum as the new user.
403
404 For proper Baculum working some Bconsole commands are necessary. They are
405 commands:
406
407 \begin{itemize}
408 \item show
409 \item .client
410 \item .jobs
411 \item .fileset
412 \item .pool
413 \item .storage
414 \item .jobs
415 \item .bvfs\_update
416 \item .bvfs\_lsdirs
417 \item .bvfs\_lsfiles
418 \item .bvfs\_versions
419 \item .bvfs\_get\_jobids
420 \item .bvfs\_restore
421 \item restore
422 \end{itemize}
423
424 Example configuration of the Restricted Console can look like below:
425
426 \begin{verbatim}
427 Console {
428     Name = "BaculaRestrictedUser"
429     Password = "XXXXXXXXX"
430     CommandACL = run,show,.client,.jobs,.fileset,.pool,.storage,.jobs,.bvfs_update,
431 .bvfs_lsdirs,.bvfs_lsfiles,.bvfs_versions,.bvfs_get_jobids,.bvfs_restore,restore
432     CatalogACL = *all*
433     ClientACL = user-fd
434     JobACL = somejob1,userjob
435     PoolACL = Full-Pool
436     StorageACL = VTL
437     FileSetACL = somejob1-fileset,userjobFileSet3
438     WhereACL = *all*
439 }
440 \end{verbatim}
441
442 \section{Screenshots}
443
444 \includegraphics{baculum01.png}
445
446 \includegraphics{baculum02.png}
447
448 \includegraphics{baculum03.png}
449
450 \includegraphics{baculum04.png}
451
452 \includegraphics{baculum05.png}
453
454 \includegraphics{baculum06.png}