]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/INSTALL
Update install script
[bacula/bacula] / gui / bweb / INSTALL
1 ################################################################
2 #               INSTALL NOTES                                  #
3 ################################################################
4
5 Bweb works well with 1.39 release or later.
6
7 1) install perl lib
8 2) copy your files
9 3) intialise 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
13 7) bweb limitation
14 8) using sudo with autochanger
15 9) using bfileview.pl
16 10) accessing to bweb
17
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
22  cd gui
23
24  # or get them from the released tar files or from the apt or rpms.
25
26  # first, copy the bweb perl library into your PERL5 INC path
27  perl Makefile.PL
28  make install
29  # or
30  install -m 644 -o root -g root  bweb/lib/*.pm /usr/share/perl5
31
32  # copy the bweb perl program to your cgi location
33  mkdir -m 755 /usr/lib/cgi-bin/bweb
34  install -m 755 -o root -g root  bweb/cgi/*.pl /usr/lib/cgi-bin/bweb
35
36  # get a config file
37  mkdir -m 755 /etc/bacula
38  chown root:bacula /etc/bacula
39  echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl" };' > /etc/bacula/bweb.conf
40  chown www-data /etc/bacula/bweb.conf
41
42  # copy the bweb template file
43  mkdir -p /usr/share/bweb/tpl
44  install -m 644 -o root -g root  bweb/tpl/*.tpl /usr/share/bweb/tpl
45
46  # copy the bweb graphics elements (bweb elements must reside in /bweb)
47  mkdir /var/www/bweb
48  install -m 644 -o root -g root  bweb/html/*.{js,png,css,gif,ico} /var/www/bweb
49
50  # done !
51
52  WARNING : Your www-data user must be able to execute bconsole and able 
53            to read the bconsole.conf file!
54            You can create an bconsole group for that.
55
56 ################ USE FRENCH VERSION ############################
57
58 Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl
59
60 ################ INSTALL PERL LIBRARY ##########################
61
62  - perl modules
63     - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
64     - Gd::Graph
65     - Gd
66     - HTML::Template
67     - CGI
68     - Expect
69     - Time::ParseDate
70
71  You can install perl modules with CPAN
72  perl -e shell -MCPAN
73   > install Expect
74
75  Or use your distribution
76  apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
77  apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl libtime-modules-perl
78
79 ################ APACHE CONFIGURATION ##########################
80
81 It could be a good idea to protect your bweb installation.
82
83 Put this in your httpd.conf, and add user with htpasswd
84
85 <Directory /usr/lib/cgi-bin/bweb>
86         Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
87         AuthType Basic
88         AuthName MyPrivateFile
89         AuthUserFile /etc/apache/htpasswd
90         AllowOverride None
91         Require valid-user
92 </Directory>
93
94
95 ################ CONFIGURATION #################################
96
97 /etc/bacula/bweb.conf looks like : (you can edit it inside bweb)
98 $VAR1 = bless( {
99   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
100   'name' => undef,
101   'config_file' => '/etc/bacula/bweb.conf',
102   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
103   'ach_list' => {
104      'S1_L80' => bless( {
105          'info' => {
106                      'drive' => 0,
107                      'io' => 0,
108                      'slot' => 0
109                    },
110          'name' => 'S1_L80',
111          'bweb' => undef,
112          'device' => '/dev/changer',
113          'drive' => [],
114          'debug' => 0,
115          'label' => {},
116          'precmd' => 'sudo',
117          'io' => [],
118          'mtxcmd' => '/usr/sbin/mtx',
119          'drive_name' => [
120                            'S1_L80_SDLT0',
121                            'S1_L80_SDLT1'
122                          ],
123          'slot' => []
124        }, 'Bweb::Autochanger' )
125    },
126   'password' => 'xxx',
127   'template_dir' => '/usr/share/bweb/tpl',
128   'dbi' => 'DBI:mysql:database=bacula',
129   'error' => '',
130   'debug' => 0,
131   'user' => 'bacula',
132   'email_media' => 'eric@localhost'
133 }, 'Bweb::Config' );
134
135
136 ################ BRESTORE ######################################
137
138 If you want to use brestore with bweb, you must associate a mime type
139 text/brestore with your brestore.pl.
140
141 ################ POSTGRESQL NOTES ##############################
142
143 If you want to use PostgreSQL instead of MySQL, you must add
144 a function to the PostgreSQL Bacula database to get Bweb to work.
145
146 psql -u bacula bacula < script/bweb-postgresql.sql
147
148 ################ BCONSOLE NOTES ################################
149
150 You must use bconsole without conio/readline support. For that, use
151 the bconsole -n option.
152
153 ################ BACULA LOG ####################################
154
155 To use Bweb log engine you MUST use catalog message type.
156
157 Messages {
158   Name = Standard
159
160   operator = root@localhost = mount
161   console = all, !skipped, !saved
162   append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
163
164   catalog = all, !skipped, !saved
165 }
166
167
168 ################ BWEB LIMITATION ###############################
169
170 To get bweb working, you must follow these rules
171  - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
172  - AutoChanger name must be same as Device and Location name in bacula
173
174 ################ SUDO CONFIGURATION ############################
175
176 If you use sudo, put this on you /etc/sudoers
177
178 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
179 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
180 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
181 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *
182
183 ################ BFILEVIEW SETUP ###############################
184
185 At this time, bfileview works only with PostgreSQL.
186
187 Alias /bweb/fv /var/spool/bweb
188 <Directory "/var/spool/bweb">
189     Options None
190     AllowOverride AuthConfig
191     Order allow,deny
192     Allow from all
193 </Directory>
194
195 mkdir /var/spool/bweb
196 chmod 700 /var/spool/bweb
197 chown www-data /var/spool/bweb
198
199 You have to remove "<!-- Remove this to activate bfileview" and "-->" from
200 tpl/display_job_zoom.tpl.
201
202 You must use brestore.pl -b to initialise the database, and
203 you can use bfileview.pl mode=batch jobid=xxx where=/ to compute tree size.
204
205 At this time, it's a good idea to schedule brestore.pl -b after your 
206 BackupCatalog job.
207
208 Job {
209   Name = "BackupCatalog"
210   ...
211   # This creates an ASCII copy of the catalog
212   RunBeforeJob = "/opt/bacula/etc/make_catalog_backup bacula bacula Pei0ahm9"
213   # This deletes the copy of the catalog
214   RunAfterJob  = "/opt/bacula/etc/delete_catalog_backup"
215   RunAfterJob  = "/usr/local/bin/brestore.pl -b"
216 }
217
218 To upgrade from an old installation, you can use :
219 ALTER TABLE brestore_pathvisibility ADD Size int8;
220 ALTER TABLE brestore_pathvisibility ADD Files int4;
221
222 ################ ACCESSING TO BWEB ###############################
223
224 Now, you are able to launch firefox/mozilla and go on
225 http://your-server/bweb
226
227 Enjoy !