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