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