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 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
18 ################ FILE COPY #####################################
19 # you must get bweb cvs files
20 cvs -d:pserver:anonymous@bacula.cvs.sourceforge.net:/cvsroot/bacula login
21 cvs -z3 -d:pserver:anonymous@bacula.cvs.sourceforge.net:/cvsroot/bacula co -P gui
24 # or get them from the released tar files or from the apt or rpms.
27 # Once you have the gui directory loaded, follow the instructions below
28 # or edit the environment variables in the file install_bweb
29 # then execute it. install_web does everything to the next
33 # first, copy the bweb Perl library into your PERL5 INC path
37 install -m 644 -o root -g root bweb/lib/*.pm /usr/share/perl5
39 # copy the bweb perl program to your cgi location
40 mkdir -m 755 /usr/lib/cgi-bin/bweb
41 install -m 755 -o root -g root bweb/cgi/*.pl /usr/lib/cgi-bin/bweb
44 mkdir -m 755 /etc/bacula
45 chown root:bacula /etc/bacula
46 echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl" };' > /etc/bacula/bweb.conf
47 chown www-data /etc/bacula/bweb.conf
49 # copy the bweb template file
50 mkdir -p /usr/share/bweb/tpl
51 install -m 644 -o root -g root bweb/tpl/*.tpl /usr/share/bweb/tpl
53 # copy the bweb graphics elements (bweb elements must reside in /bweb)
55 install -m 644 -o root -g root bweb/html/*.{js,png,css,gif,ico,html} /var/www/bweb
59 WARNING : Your www-data (or wwwrun on SuSE) user must be able to execute bconsole and able
60 to read the bconsole.conf file!
61 You can create an bconsole group for that.
63 ################ USE FRENCH VERSION ############################
65 Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl
67 ################ INSTALL PERL LIBRARY ##########################
70 - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
78 You can install perl modules with CPAN
82 Or use your distribution
83 apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
84 apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl libtime-modules-perl
86 Note: the best way to test if you have all the dependencies
87 fullfilled for Perl is to:
89 cd /var/www/cgi-bin/bweb
92 you might also want to try:
96 To make sure the graphing modules are loaded. However, running it
97 will spray binary graphics data on your terminal. Otherwise, you will
100 That should show you if any of the pre-requisites are missing.
101 On SuSE 10.2, I was able to load all the appropriate modules via rpms,
102 with the exception of Expect and Time::ParseDate, which I loaded manually
105 If you experience problems, always consult the Apache error_log
108 ################ APACHE CONFIGURATION ##########################
110 It could be a good idea to protect your bweb installation (optional).
112 Put this in your httpd.conf, and add user with htpasswd
114 <Directory /usr/lib/cgi-bin/bweb>
115 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
117 AuthName MyPrivateFile
118 AuthUserFile /etc/apache/htpasswd
123 On SuSE 10.2, the following in /etc/apache2/default-server.conf works.
124 However, it is not secure:
126 Directory "/srv/www/cgi-bin/bweb">
128 Options +ExecCGI -Includes
134 ################ CONFIGURATION #################################
136 Note, this is automatically installed by the install_bweb script.
138 /etc/bacula/bweb.conf looks like : (you can edit it inside bweb)
140 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
142 'config_file' => '/etc/bacula/bweb.conf',
143 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
153 'device' => '/dev/changer',
159 'mtxcmd' => '/usr/sbin/mtx',
165 }, 'Bweb::Autochanger' )
168 'template_dir' => '/usr/share/bweb/tpl',
169 'dbi' => 'DBI:mysql:database=bacula',
173 'email_media' => 'eric@localhost'
177 ################ BRESTORE ######################################
179 If you want to use brestore with bweb, you must associate a mime type
180 text/brestore with your brestore.pl, and you must install brestore.
181 See gui/brestore/README for instructions on installing brestore.pl.
183 ################ POSTGRESQL NOTES ##############################
185 If you want to use PostgreSQL instead of MySQL, you must add
186 a function to the PostgreSQL Bacula database to get Bweb to work.
188 psql -u bacula bacula < script/bweb-postgresql.sql
190 ################ BCONSOLE NOTES ################################
192 You must use bconsole without conio/readline support. For that, use
193 the bconsole -n option. This is done automatically with the standard
194 configuration file. In addition, please ensure that the binary
195 bconsole file can be executed by your web server. It is normally
196 located in /usr/bin/bconsole (or some such file), and must have
197 modes 755 or it will not be executable by your web server. The
198 normal Bacula installation usually sets mode 750.
200 ################ BACULA LOG ####################################
202 If you want Bweb to be able to show listings of the Job output,
203 you must add a "catalog = all, !skipped, !saved" to your
204 messages resource in bacula-dir.conf and restart your Bacula
205 server. This is shown below:
210 operator = root@localhost = mount
211 console = all, !skipped, !saved
212 append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
214 catalog = all, !skipped, !saved
218 ################ BWEB LIMITATION ###############################
220 To get bweb working, you must follow these rules
221 - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
222 - AutoChanger name must be same as Device and Location name in bacula
224 ################ SUDO CONFIGURATION ############################
226 If you use sudo, put this on you /etc/sudoers
228 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
229 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
230 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
231 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *
233 ################ BFILEVIEW SETUP ###############################
235 At this time, bfileview works only with PostgreSQL.
237 Alias /bweb/fv /var/spool/bweb
238 <Directory "/var/spool/bweb">
240 AllowOverride AuthConfig
245 mkdir /var/spool/bweb
246 chmod 700 /var/spool/bweb
247 chown www-data /var/spool/bweb
249 You have to remove "<!-- Remove this to activate bfileview" and "-->" from
250 tpl/display_job_zoom.tpl.
252 You must use brestore.pl -b to initialize the database, and
253 you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
255 At this time, it's a good idea to schedule brestore.pl -b after your
259 Name = "BackupCatalog"
261 # This creates an ASCII copy of the catalog
262 RunBeforeJob = "/opt/bacula/etc/make_catalog_backup bacula bacula Pei0ahm9"
263 # This deletes the copy of the catalog
264 RunAfterJob = "/opt/bacula/etc/delete_catalog_backup"
265 RunAfterJob = "/usr/local/bin/brestore.pl -b"
268 To upgrade from an old installation, you can use :
269 ALTER TABLE brestore_pathvisibility ADD Size int8;
270 ALTER TABLE brestore_pathvisibility ADD Files int4;
272 ################ ACCESSING TO BWEB ###############################
274 Now, you are able to launch firefox/mozilla and go on
275 http://your-server/bweb