]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/INSTALL
Spelling
[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) 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
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  # Once you have all these files, follow the instructions below
27  #  or edit the environment variables in the file install_bweb
28  #  then execute it.
29  #
30
31  # first, copy the bweb Perl library into your PERL5 INC path
32  perl Makefile.PL
33  make install
34  # or
35  install -m 644 -o root -g root  bweb/lib/*.pm /usr/share/perl5
36
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
40
41  # get a config file
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
46
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
50
51  # copy the bweb graphics elements (bweb elements must reside in /bweb)
52  mkdir /var/www/bweb
53  install -m 644 -o root -g root  bweb/html/*.{js,png,css,gif,ico,html} /var/www/bweb
54
55  # done !
56
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.
60
61 ################ USE FRENCH VERSION ############################
62
63 Simply use lang/fr/tpl/*.tpl files instead of tpl/*.tpl
64
65 ################ INSTALL PERL LIBRARY ##########################
66
67  - perl modules
68     - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
69     - Gd::Graph
70     - Gd
71     - HTML::Template
72     - CGI
73     - Expect
74     - Time::ParseDate
75
76  You can install perl modules with CPAN
77  perl -e shell -MCPAN
78   > install Expect
79
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
83
84  Note: the best way to test if you have all the dependencies
85  fullfilled for Perl is to:
86   
87     cd /var/www/cgi-bin/bweb
88     ./bweb.pl 
89
90  That should show you if any of the pre-requisites are missing.
91
92 ################ APACHE CONFIGURATION ##########################
93
94 It could be a good idea to protect your bweb installation.
95
96 Put this in your httpd.conf, and add user with htpasswd
97
98 <Directory /usr/lib/cgi-bin/bweb>
99         Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
100         AuthType Basic
101         AuthName MyPrivateFile
102         AuthUserFile /etc/apache/htpasswd
103         AllowOverride None
104         Require valid-user
105 </Directory>
106
107
108 ################ CONFIGURATION #################################
109
110 /etc/bacula/bweb.conf looks like : (you can edit it inside bweb)
111 $VAR1 = bless( {
112   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
113   'name' => undef,
114   'config_file' => '/etc/bacula/bweb.conf',
115   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
116   'ach_list' => {
117      'S1_L80' => bless( {
118          'info' => {
119                      'drive' => 0,
120                      'io' => 0,
121                      'slot' => 0
122                    },
123          'name' => 'S1_L80',
124          'bweb' => undef,
125          'device' => '/dev/changer',
126          'drive' => [],
127          'debug' => 0,
128          'label' => {},
129          'precmd' => 'sudo',
130          'io' => [],
131          'mtxcmd' => '/usr/sbin/mtx',
132          'drive_name' => [
133                            'S1_L80_SDLT0',
134                            'S1_L80_SDLT1'
135                          ],
136          'slot' => []
137        }, 'Bweb::Autochanger' )
138    },
139   'password' => 'xxx',
140   'template_dir' => '/usr/share/bweb/tpl',
141   'dbi' => 'DBI:mysql:database=bacula',
142   'error' => '',
143   'debug' => 0,
144   'user' => 'bacula',
145   'email_media' => 'eric@localhost'
146 }, 'Bweb::Config' );
147
148
149 ################ BRESTORE ######################################
150
151 If you want to use brestore with bweb, you must associate a mime type
152 text/brestore with your brestore.pl.
153
154 ################ POSTGRESQL NOTES ##############################
155
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.
158
159 psql -u bacula bacula < script/bweb-postgresql.sql
160
161 ################ BCONSOLE NOTES ################################
162
163 You must use bconsole without conio/readline support. For that, use
164 the bconsole -n option.
165
166 ################ BACULA LOG ####################################
167
168 To use Bweb log engine you MUST use catalog message type.
169
170 Messages {
171   Name = Standard
172
173   operator = root@localhost = mount
174   console = all, !skipped, !saved
175   append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
176
177   catalog = all, !skipped, !saved
178 }
179
180
181 ################ BWEB LIMITATION ###############################
182
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
186
187 ################ SUDO CONFIGURATION ############################
188
189 If you use sudo, put this on you /etc/sudoers
190
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 *
195
196 ################ BFILEVIEW SETUP ###############################
197
198 At this time, bfileview works only with PostgreSQL.
199
200 Alias /bweb/fv /var/spool/bweb
201 <Directory "/var/spool/bweb">
202     Options None
203     AllowOverride AuthConfig
204     Order allow,deny
205     Allow from all
206 </Directory>
207
208 mkdir /var/spool/bweb
209 chmod 700 /var/spool/bweb
210 chown www-data /var/spool/bweb
211
212 You have to remove "<!-- Remove this to activate bfileview" and "-->" from
213 tpl/display_job_zoom.tpl.
214
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.
217
218 At this time, it's a good idea to schedule brestore.pl -b after your 
219 BackupCatalog job.
220
221 Job {
222   Name = "BackupCatalog"
223   ...
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"
229 }
230
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;
234
235 ################ ACCESSING TO BWEB ###############################
236
237 Now, you are able to launch firefox/mozilla and go on
238 http://your-server/bweb
239
240 Enjoy !