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.
26 # Once you have all these files, follow the instructions below
27 # or edit the environment variables in the file install_bweb
31 # first, copy the bweb Perl library into your PERL5 INC path
35 install -m 644 -o root -g root bweb/lib/*.pm /usr/share/perl5
37 # copy the bweb perl program to your cgi location
38 mkdir -m 755 /usr/lib/cgi-bin/bweb
39 install -m 755 -o root -g root bweb/cgi/*.pl /usr/lib/cgi-bin/bweb
42 mkdir -m 755 /etc/bacula
43 chown root:bacula /etc/bacula
44 echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl" };' > /etc/bacula/bweb.conf
45 chown www-data /etc/bacula/bweb.conf
47 # copy the bweb template file
48 mkdir -p /usr/share/bweb/tpl
49 install -m 644 -o root -g root bweb/tpl/*.tpl /usr/share/bweb/tpl
51 # copy the bweb graphics elements (bweb elements must reside in /bweb)
53 install -m 644 -o root -g root bweb/html/*.{js,png,css,gif,ico,html} /var/www/bweb
57 WARNING : Your www-data user must be able to execute bconsole and able
58 to read the bconsole.conf file!
59 You can create an bconsole group for that.
61 ################ USE FRENCH VERSION ############################
63 Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl
65 ################ INSTALL PERL LIBRARY ##########################
68 - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
76 You can install perl modules with CPAN
80 Or use your distribution
81 apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
82 apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl libtime-modules-perl
84 Note: the best way to test if you have all the dependencies
85 fullfilled for Perl is to:
87 cd /var/www/cgi-bin/bweb
90 That should show you if any of the pre-requisites are missing.
92 ################ APACHE CONFIGURATION ##########################
94 It could be a good idea to protect your bweb installation.
96 Put this in your httpd.conf, and add user with htpasswd
98 <Directory /usr/lib/cgi-bin/bweb>
99 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
101 AuthName MyPrivateFile
102 AuthUserFile /etc/apache/htpasswd
108 ################ CONFIGURATION #################################
110 /etc/bacula/bweb.conf looks like : (you can edit it inside bweb)
112 'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
114 'config_file' => '/etc/bacula/bweb.conf',
115 'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
125 'device' => '/dev/changer',
131 'mtxcmd' => '/usr/sbin/mtx',
137 }, 'Bweb::Autochanger' )
140 'template_dir' => '/usr/share/bweb/tpl',
141 'dbi' => 'DBI:mysql:database=bacula',
145 'email_media' => 'eric@localhost'
149 ################ BRESTORE ######################################
151 If you want to use brestore with bweb, you must associate a mime type
152 text/brestore with your brestore.pl.
154 ################ POSTGRESQL NOTES ##############################
156 If you want to use PostgreSQL instead of MySQL, you must add
157 a function to the PostgreSQL Bacula database to get Bweb to work.
159 psql -u bacula bacula < script/bweb-postgresql.sql
161 ################ BCONSOLE NOTES ################################
163 You must use bconsole without conio/readline support. For that, use
164 the bconsole -n option.
166 ################ BACULA LOG ####################################
168 To use Bweb log engine you MUST use catalog message type.
173 operator = root@localhost = mount
174 console = all, !skipped, !saved
175 append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
177 catalog = all, !skipped, !saved
181 ################ BWEB LIMITATION ###############################
183 To get bweb working, you must follow these rules
184 - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
185 - AutoChanger name must be same as Device and Location name in bacula
187 ################ SUDO CONFIGURATION ############################
189 If you use sudo, put this on you /etc/sudoers
191 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
192 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
193 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
194 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *
196 ################ BFILEVIEW SETUP ###############################
198 At this time, bfileview works only with PostgreSQL.
200 Alias /bweb/fv /var/spool/bweb
201 <Directory "/var/spool/bweb">
203 AllowOverride AuthConfig
208 mkdir /var/spool/bweb
209 chmod 700 /var/spool/bweb
210 chown www-data /var/spool/bweb
212 You have to remove "<!-- Remove this to activate bfileview" and "-->" from
213 tpl/display_job_zoom.tpl.
215 You must use brestore.pl -b to initialize the database, and
216 you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
218 At this time, it's a good idea to schedule brestore.pl -b after your
222 Name = "BackupCatalog"
224 # This creates an ASCII copy of the catalog
225 RunBeforeJob = "/opt/bacula/etc/make_catalog_backup bacula bacula Pei0ahm9"
226 # This deletes the copy of the catalog
227 RunAfterJob = "/opt/bacula/etc/delete_catalog_backup"
228 RunAfterJob = "/usr/local/bin/brestore.pl -b"
231 To upgrade from an old installation, you can use :
232 ALTER TABLE brestore_pathvisibility ADD Size int8;
233 ALTER TABLE brestore_pathvisibility ADD Files int4;
235 ################ ACCESSING TO BWEB ###############################
237 Now, you are able to launch firefox/mozilla and go on
238 http://your-server/bweb