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