]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/INSTALL
ebl add comment and recyclepool
[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 ################ INSTALL PERL LIBRARY ##########################
49
50  - perl modules
51     - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
52     - Gd::Graph
53     - HTML::Template
54     - CGI
55     - Expect
56     - Time::ParseDate
57
58  You can install perl modules with CPAN
59  perl -e shell -MCPAN
60   > install Expect
61
62  Or use your distribution
63  apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
64  apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl libtime-modules-perl
65
66 ################ APACHE CONFIGURATION ##########################
67
68 It could be a good idea to protect your bweb installation.
69
70 Put this in you httpd.conf, and add user with htpasswd
71
72 <Directory /usr/lib/cgi-bin/bweb>
73         Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
74         AuthType Basic
75         AuthName MyPrivateFile
76         AuthUserFile /etc/apache/htpasswd
77         AllowOverride None
78         Require valid-user
79 </Directory>
80
81
82 ################ CONFIGURATION #################################
83
84 /etc/bweb/config looks like : (you can edit it inside bweb)
85 $VAR1 = bless( {
86   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
87   'name' => undef,
88   'config_file' => '/etc/bweb/config',
89   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
90   'ach_list' => {
91      'S1_L80' => bless( {
92          'info' => {
93                      'drive' => 0,
94                      'io' => 0,
95                      'slot' => 0
96                    },
97          'name' => 'S1_L80',
98          'bweb' => undef,
99          'device' => '/dev/changer',
100          'drive' => [],
101          'debug' => 0,
102          'label' => {},
103          'precmd' => 'sudo',
104          'io' => [],
105          'mtxcmd' => '/usr/sbin/mtx',
106          'drive_name' => [
107                            'S1_L80_SDLT0',
108                            'S1_L80_SDLT1'
109                          ],
110          'slot' => []
111        }, 'Bweb::Autochanger' )
112    },
113   'password' => 'xxx',
114   'template_dir' => '/usr/share/bweb/tpl',
115   'dbi' => 'DBI:mysql:database=bacula',
116   'error' => '',
117   'debug' => 0,
118   'user' => 'bacula',
119   'email_media' => 'eric@localhost'
120 }, 'Bweb::Config' );
121
122
123 ################ BRESTORE ######################################
124
125 If you want to use brestore with bweb, you must associate mime type
126 text/brestore with your brestore.pl.
127
128 ################ POSTGRESQL NOTES ##############################
129
130 If you think that Mysql is not a great database (or just a toy), you must add
131 function to the Postgresql bacula database to get Bweb works.
132
133 psql -u bacula bacula < script/bweb-postgresql.sql
134
135 ################ BCONSOLE NOTES ################################
136
137 You must use bconsole without conio/readline support. For that, use
138 bconsole -n option.
139
140 ################ BACULA LOG ####################################
141
142 To use Bweb log engine you MUST use catalog message type.
143
144 Messages {
145   Name = Standard
146
147   operator = root@localhost = mount
148   console = all, !skipped, !saved
149   append = "/tmp/bacula/var/bacula/working/log" = all, !skipped
150
151   catalog = all, !skipped, !saved
152 }
153
154
155 ################ BWEB LIMITATION ###############################
156
157 To get bweb working, you must follow these rules
158  - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
159  - AutoChanger name must be same as Device and Location name in bacula
160
161 ################ SUDO CONFIGURATION ############################
162
163 If you use sudo, put this on you /etc/sudoers
164
165 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
166 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
167 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
168 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *
169
170
171 Enjoy !