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