1 ################################################################
3 ################################################################
5 Bweb works well with 1.39 release or later.
9 3) initialize your configuration file
10 4) do some sql stuff (for postgresql or mysql 5 users)
11 5) use the -n option on bconsole so that it works with Expect
12 6) get bacula log more useful
14 8) using sudo with autochanger
17 11) setting mysql read-only account
18 12) get more statistics
19 13) use groups with bweb
20 14) setup restoration in bweb (not yet working)
22 ################ FILE COPY #####################################
23 # you must get bweb svn files
24 svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula/trunk/gui/bweb bweb
26 # or get them from the released tar files or from the apt or rpms.
29 # Once you have the gui directory loaded, follow the instructions below
30 # or edit the environment variables in the file install_bweb
31 # then execute it. install_web does everything to the next
35 # first, copy the bweb Perl library into your PERL5 INC path
39 install -m 644 -o root -g root bweb/lib/*.pm /usr/share/perl5
41 # copy the bweb perl program to your cgi location
42 mkdir -m 755 /usr/lib/cgi-bin/bweb
43 install -m 755 -o root -g root bweb/cgi/*.pl /usr/lib/cgi-bin/bweb
46 mkdir -m 755 /etc/bacula
47 chown root:bacula /etc/bacula
48 echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl" };' > /etc/bacula/bweb.conf
49 chown www-data /etc/bacula/bweb.conf
51 # copy the bweb template file
52 mkdir -p /usr/share/bweb/tpl
53 install -m 644 -o root -g root bweb/tpl/*.tpl /usr/share/bweb/tpl
55 # copy the bweb graphics elements (bweb elements must reside in /bweb)
57 install -m 644 -o root -g root bweb/html/*.{js,png,css,gif,ico,html} /var/www/bweb
61 WARNING : Your www-data (or wwwrun on SuSE) user must be able to execute bconsole and able
62 to read the bconsole.conf file!
63 You can create an bconsole group for that.
65 ################ USE FRENCH VERSION ############################
67 Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl
69 ################ INSTALL PERL LIBRARY ##########################
72 - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
73 (SQLite is not supported)
81 You can install perl modules with CPAN
85 Or use your distribution
86 apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
87 apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl libtime-modules-perl
89 Note: the best way to test if you have all the dependencies
90 fullfilled for Perl is to:
92 cd /var/www/cgi-bin/bweb
95 you might also want to try:
99 To make sure the graphing modules are loaded. However, running it
100 will spray binary graphics data on your terminal. Otherwise, you will
103 That should show you if any of the pre-requisites are missing.
104 On SuSE 10.2, I was able to load all the appropriate modules via rpms,
105 with the exception of Expect and Time::ParseDate, which I loaded manually
108 If you experience problems, always consult the Apache error_log
111 ################ APACHE CONFIGURATION ##########################
113 It could be a good idea to protect your bweb installation (optional).
115 Put this in your httpd.conf, and add user with htpasswd
117 <Directory /usr/lib/cgi-bin/bweb>
118 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
120 AuthName MyPrivateFile
121 AuthUserFile /etc/apache/htpasswd
126 On SuSE 10.2, the following in /etc/apache2/default-server.conf works.
127 However, it is not secure:
129 Directory "/srv/www/cgi-bin/bweb">
131 Options +ExecCGI -Includes
137 ################ CONFIGURATION #################################
139 Note, this is automatically installed by the install_bweb script.
141 /etc/bacula/bweb.conf looks like : (you can edit it inside bweb)
143 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
145 'config_file' => '/etc/bacula/bweb.conf',
146 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
156 'device' => '/dev/changer',
162 'mtxcmd' => '/usr/sbin/mtx',
168 }, 'Bweb::Autochanger' )
171 'template_dir' => '/usr/share/bweb/tpl',
172 'dbi' => 'DBI:mysql:database=bacula',
176 'email_media' => 'eric@localhost'
180 ################ BRESTORE ######################################
182 If you want to use brestore with bweb, you must associate a mime type
183 text/brestore with your brestore.pl, and you must install brestore.
184 See gui/brestore/README for instructions on installing brestore.pl.
186 ################ POSTGRESQL AND MYSQL5 NOTES ####################
188 If you want to use PostgreSQL instead of MySQL, you must add
189 a function to the PostgreSQL Bacula database to get Bweb to work.
191 psql -U bacula bacula < script/bweb-postgresql.sql
193 Tips: PL must be enabled in your cluster, you can do this with postgres user
194 postgres:~$ echo 'CREATE PROCEDURAL LANGUAGE plpgsql;' | psql bacula
197 To get database size with mysql5, edit Bweb.pm and change the DB_SIZE macro
199 # with mysql < 5, you have to play with the ugly SHOW command
200 DB_SIZE => " SELECT 0 ",
201 # works only with mysql 5
202 # DB_SIZE => " SELECT sum(DATA_LENGTH) FROM INFORMATION_SCHEMA.TABLES ",
204 ################ BCONSOLE NOTES ################################
206 You must use bconsole without conio/readline support. For that, use
207 the bconsole -n option. This is done automatically with the standard
208 configuration file. In addition, please ensure that the binary
209 bconsole file can be executed by your web server. It is normally
210 located in /usr/bin/bconsole (or some such file), and must have
211 modes 755 or it will not be executable by your web server. The
212 normal Bacula installation usually sets mode 750.
214 ################ BACULA LOG ####################################
216 If you want Bweb to be able to show listings of the Job output,
217 you must add a "catalog = all, !skipped, !saved" to your
218 messages resource in bacula-dir.conf and restart your Bacula
219 server. This is shown below:
224 operator = root@localhost = mount
225 console = all, !skipped, !saved
226 append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
228 catalog = all, !skipped, !saved
232 ################ BWEB LIMITATION ###############################
234 To get bweb working, you must follow these rules
235 - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
236 - AutoChanger name must be same as Device and Location name in bacula
238 ################ SUDO CONFIGURATION ############################
240 If you use sudo, put this on you /etc/sudoers
242 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
243 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
244 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
245 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *
247 ################ BFILEVIEW SETUP ###############################
249 At this time, bfileview works only with PostgreSQL.
251 Alias /bweb/fv /var/spool/bweb
252 <Directory "/var/spool/bweb">
254 AllowOverride AuthConfig
259 mkdir /var/spool/bweb
260 chmod 700 /var/spool/bweb
261 chown www-data /var/spool/bweb
263 You have to remove "<!-- Remove this to activate bfileview" and "-->" from
264 tpl/display_job_zoom.tpl.
266 You MUST use brestore.pl -b to initialize the database, and
267 you CAN use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
269 At this time, it's a good idea to schedule brestore.pl -b after your
273 Name = "BackupCatalog"
275 # This creates an ASCII copy of the catalog
276 RunBeforeJob = "/opt/bacula/etc/make_catalog_backup bacula bacula Pei0ahm9"
277 # This deletes the copy of the catalog
278 RunAfterJob = "/opt/bacula/etc/delete_catalog_backup"
279 RunAfterJob = "/usr/local/bin/brestore.pl -b"
282 To upgrade from an old installation, you can use :
283 ALTER TABLE brestore_pathvisibility ADD Size int8;
284 ALTER TABLE brestore_pathvisibility ADD Files int4;
286 ################ ACCESSING TO BWEB ############################
288 Now, you are able to launch firefox/mozilla and go on
289 http://your-server/bweb
291 ################ SETTING MYSQL ACCOUNT ########################
293 At this time, Bweb needs a write access to :
298 - Media::RecyclePoolId (it will change soon)
300 If your doesn't use Location feature, you can use ReadOnly access
301 for all tables, or setup something like :
303 GRANT SELECT ON bacula.* TO 'bweb'@'%' IDENTIFIED BY 'password';
304 GRANT INSERT,UPDATE,DELETE ON bacula.Location
305 TO 'bweb'@'%' IDENTIFIED BY 'password';
306 GRANT INSERT,UPDATE,DELETE ON bacula.LocationLog
307 TO 'bweb'@'%' IDENTIFIED BY 'password';
309 ################ GET MORE STATISTICS ###########################
311 You keep Jobs informations across retention into a job_old table.
312 You have to setup stat_job_table = job_old in bweb configuration.
314 CREATE TABLE job_old (LIKE Job);
316 And run this on crontab when you want :
318 (SELECT * FROM Job WHERE JobId NOT IN (SELECT JobId FROM job_old) );
320 ################ USE GROUPS WITH BWEB ##########################
322 It works with postgresql and mysql5 (4 not tested).
323 With mysql, load bweb/script/bweb-mysql.sql into your catalog
324 For postgresql, it will be done with bweb/script/bweb-postgresql.sql (already done)
326 ################ MADE RESTORATION WITH BWEB ####################
328 Warning, this function is not for production use at this time !
329 It will do some basics things on a working bweb/brestore setup.
331 1) Go to http://extjs.com and download their toolkit (last 1.X release)
333 2) Install files in /bweb/ext web root
335 root@localhost:~# mv ext-1.1.1 /usr/share/bweb/html/ext
337 3) Make sure that brestore cache tables are updated with brestore.pl
338 bacula@localhost:~$ brestore.pl -b
340 4) Enable bresto.pl cgi.
341 edit the bweb/cgi/bresto.pl script and change $bresto_enable=0; to $bresto_enable=1;
342 on the top of the file.
344 5) Use the last Bweb.pm
345 If you are trying bresto in a working bweb/brestore setup, you must make sure that you use
346 the last Bweb.pm SVN version.
348 6) Go on http://you-director/bweb/bresto.html
350 ################################################################