]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/INSTALL
baculum: Tweak escape config file values
[bacula/bacula] / gui / baculum / INSTALL
1 1. Baculum overview
2 2. Operating system environment
3   2.1 General requirements
4   2.2 Linux Fedora
5   2.3 Linux Debian
6 3. Preparing Baculum files
7 4. Preparing Apache Web Server
8 5. Example VirtualHost configuration
9 6. Useful configuration samples
10 7. Makefile
11
12 =========================================
13
14 1. Baculum overview
15
16
17 Baculum is Bacula web based interface. It enables Bacula administration
18 functions such as:
19
20 - Running Bacula jobs (backup, restore, verify...)
21 - Monitoring Bacula services by getting status these services
22 - Bacula console available via web interface
23 - Support for customized and restricted consoles (Console ACL functionality)
24 - Multiple Directors support
25 - Volumes management including labeling new volumes
26 - User friendly graphs
27 - Basic storage daemon operations on volumes (mount, umount, release actions)
28 - Easy in use configuration and restore wizards
29 - other features...
30
31
32 2. Operating system environment
33
34
35 2.1 General requirements
36
37
38 Environment for Baculum installation should have following components:
39
40 - Web Server - with mod_rewrite module loaded. Baculum has been
41 tested with Apache HTTP Server and Lighttpd.
42
43 - PHP 5.3 or higher - PHP CLI interpreter is unneeded.
44 PHP should have installed following modules:
45     * PDO PHP support - depending on your catalog database: PDO PostgreSQL,
46 PDO MySQL or PDO SQLite.
47       Note, in case using MySQL database there is required to use MySQL native driver.
48       It is php-mysqlnd for PHP, not php-mysql.
49     * BCMath PHP module.
50     * cURL PHP module.
51     * MB String PHP module.
52     * JSON PHP module.
53     * XML PHP module.
54 - Bconsole - configured Bacula text based console
55 - Access to Bacula catalog database - computer with Baculum installation should be
56 able to connect to Bacula catalog database. There is not need to install Baculum
57 on server with Bacula Catalog DB because Baculum can communicate with Bacula database
58 located on remote server.
59
60 Above requirements are validated during Baculum start. So if in installation
61 environment there is lack some from these components then you will be informed
62 about it.
63
64
65 2.2 Linux Fedora
66
67
68 Packages required to run Baculum in Fedora environment can be installed by command:
69
70 # yum install httpd \
71 php \
72 php-common \
73 php-pdo \
74 php-pgsql \
75 php-mysqlnd \
76 php-mbstring \
77 php-bcmath \
78 php-xml
79
80 In Fedora 20 PHP module for cURL support and for JSON support are compiled in PHP.
81
82 In case of using SELinux functionality in Baculum environment there is need
83 to load SELinux policy module provided together with Baculum sources in location:
84
85 examples/selinux/baculum.pp
86
87 To load the policy module there can be used following command:
88
89 semodule -i baculum.pp
90
91 Source file the policies module is located in:
92
93 examples/selinux/baculum.te
94
95
96 Please make sure that in PHP configuration file (usually located in /etc/php.ini)
97 there is option error_reporting set as below:
98
99 error_reporting = E_ALL & ~E_STRICT
100 memory_limit = 256M
101
102 Suggested method for Baculum webGUI access to Bacula Console (bconsole) is using
103 "sudo" functionality for that. In this case there is need to add to /etc/sudoers file two
104 lines according to following template:
105
106 Defaults:apache_user    !requiretty
107 apache_user ALL= NOPASSWD:      bconsole_path
108
109 For example for user called "apache" from that HTTP service working with Baculum
110 there is need to add line like below:
111
112 Defaults:apache !requiretty
113 apache  ALL= NOPASSWD:  /usr/sbin/bconsole
114
115
116 2.3 Linux Debian
117
118
119 Packages required to run Baculum in Debian environment can be installed by command:
120
121 # apt-get install apache2 \
122 libapache2-mod-php5 \
123 php5 \
124 php5-pgsql \
125 php5-mysql \
126 php5-curl \
127 php5-json
128
129 In Debian 7.4.0, PHP modules for BCMath and MultiByte String support are compiled in PHP.
130
131 There is need to create symbolic link as below, for enable mod_rewrite module in Apache.
132
133 # ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
134
135 Please make sure that in PHP configuration file (usually located in /etc/php5/apache2/php.ini)
136 there is option error_reporting set as below:
137
138 error_reporting = E_ALL & ~E_STRICT
139 memory_limit = 256M
140
141 Suggested method for Baculum webGUI access to Bacula Console (bconsole) is using
142 "sudo" functionality for that. In this case there is need to add to /etc/sudoers below
143 line according to following template:
144
145 Defaults:apache_user    !requiretty
146 apache_user ALL= NOPASSWD:      bconsole_path
147
148 For example for user called "www-data" from that HTTP service working with Baculum
149 there is need to add line like below:
150
151 Defaults:www-data       !requiretty
152 www-data        ALL= NOPASSWD:  /usr/sbin/bconsole
153
154
155 3. Preparing Baculum files
156
157
158 After downloading and unpacking Baculum sources archive there is need to set write
159 permissions for web server for three below directories:
160
161 /[files base location]/assets
162 /[files base location]/protected/Data
163 /[files base location]/protected/runtime
164
165 These directories permissions are validated during Baculum start. If web server
166 will not be able to write data in some from above directories then you will be
167 informed about this fact.
168
169
170 4. Preparing Apache Web Server
171
172
173 First there is need to configure authentication to Baculum from web server side.
174 Baculum supports HTTP Basic authentication from web server with passwords stored
175 in file:
176
177 ./protected/Data/baculum.users
178
179 NOTE!
180 There is possible to use another location than:
181  ./protected/Data/baculum.users
182 however then is required provide the same auth data in Baculum initial wizard.
183
184 In Apache web server this authentication method may be realized by following
185 directives declaration in Apache configuration file:
186
187 AuthType Basic
188 AuthUserFile /var/www/baculum/protected/Data/baculum.users
189 Require valid-user
190
191 For creating passwords file you can use htpasswd binary file in following way:
192
193 # htpasswd -c /var/www/baculum/protected/Data/baculum.users someuser
194
195 You will be asked about inputting password and retype password for user.
196
197 NOTE!
198 "-c" switcher you should use only for new created passwords file. For existing
199 passwords file "-c" switcher should not be typed.
200
201 NOTE!
202 From version 7.2.0 plain text passwords for HTTP Basic authentication are no longer
203 supported by Baculum. For more information please see README file (FAQ, point "b").
204
205 At the end there is need to give web server user possibility to manage the auth file,
206 for example:
207
208 # chown www-data:www-data /var/www/baculum/protected/Data/baculum.users
209
210
211 5. Example VirtualHost configuration
212
213
214 <VirtualHost *:80>
215         DocumentRoot /var/www/baculum
216         ServerName somehost.example.com
217         <Directory /var/www/baculum>
218                 AllowOverride All
219                 AuthType Basic
220                 AuthName MyPrivateFile
221                 AuthUserFile /var/www/baculum/protected/Data/baculum.users
222                 Require valid-user
223         </Directory>
224 </VirtualHost>
225
226
227 Above configuration should be written in a new Apache configuration file.
228 for example, location for that can be put to /etc/apache2/sites-enabled/baculum.conf.
229
230 In this way, configuration file baculum.conf will be loaded automatically during
231 Apache server start.
232
233
234 6. Useful configuration samples
235
236
237 In directory examples/ exists following configuration samples:
238  ./examples/selinux/                                 <=== SELinux module example
239  ./examples/selinux/baculum.te                       <--- SELinux text module format
240  ./examples/selinux/baculum.pp                       <--- SELinux binary module format
241  ./examples/deb/                                     <=== samples for some deb-based distributions
242  ./examples/deb/baculum.startup                      <--- Baculum SysVinit startup script
243  ./examples/deb/baculum.lighttpd.conf                <--- sample Lighttpd config
244  ./examples/deb/baculum.users                        <--- sample HTTP Basic auth file (user: admin, pass: admin)
245  ./examples/deb/baculum-apache.conf                  <--- sample Apache config
246  ./examples/deb-template                             <=== Directory with templates used by Makefile
247  ./examples/deb-template/baculum.users               <--- sample HTTP Basic auth file (user: admin, pass: admin)
248  ./examples/deb-template/baculum-lighttpd.conf       <--- Lighttpd config template
249  ./examples/deb-template/baculum-lighttpd.service    <--- Baculum systemd unit for Lighttpd
250  ./examples/deb-template/baculum-apache.conf         <--- Apache config template
251  ./examples/rpm-template/                            <=== Directory with templates used by Makefile
252  ./examples/rpm-template/baculum-apache.conf         <--- Apache config template
253  ./examples/rpm-template/baculum-lighttpd.service    <--- Baculum systemd unit for Lighttpd
254  ./examples/rpm-template/baculum.spec                <--- SPEC file
255  ./examples/rpm-template/baculum-lighttpd.conf       <--- Lighttpd config template
256  ./examples/rpm-template/baculum.users               <--- HTTP Basic auth file used by SPEC (user: admin, pass: admin)
257  ./examples/rpm-template/baculum.startup             <--- Baculum SysVinit startup script
258  ./examples/sudo/                                    <=== example sudoers.d configurations
259  ./examples/sudo/baculum-httpd                       <--- sample sudo for Apache user
260  ./examples/sudo/baculum-lighttpd                    <--- sample sudo for Lighttpd user
261  ./examples/sudo/baculum-nginx                       <--- sample sudo for Nginx user
262  ./examples/rpm/                                     <=== samples for some rpm-based distributions
263  ./examples/rpm/baculum-apache.conf                  <--- Apache config file
264  ./examples/rpm/baculum-lighttpd.service             <--- Baculum system unit
265  ./examples/rpm/baculum.spec                         <--- example SPEC file
266  ./examples/rpm/baculum-lighttpd.conf                <--- Lighttpd config file
267  ./examples/rpm/baculum.users                        <--- HTTP Basic auth file (user: admin, pass: admin)
268  ./examples/rpm/baculum.startup                      <--- Baculum SysVinit startup script
269  ./examples/nginx/                                   <=== example Nginx configurations
270  ./examples/nginx/php-fpm/baculum-php.conf           <--- example PHP-FPM config for Nginx
271  ./examples/nginx/baculum.conf                       <--- sample Nginx config
272
273
274 7 Makefile
275
276
277 Together with Baculum source code is provided Makefile file. The Makefile is dedicated
278 mainly for separating and generating runtime files (including web servers configuration,
279 systemd unit and others).
280
281 Generating runtime files can be useful to prepare Baculum binary packages by execute
282 the Makefile in deb metafiles or in rpm SPEC file.
283
284 Example usage:
285
286 # cd baculum/
287 # make DESTDIR=/home/abc/baculum_runtime