1 ################################################################
3 ################################################################
5 Bweb works well with 1.39 release.
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
14 8) using sudo with autochanger
16 ################ FILE COPY #####################################
18 # first, copy bweb perl librarie in your PERL5 INC path
19 install -m 644 -o root -g root bweb/lib/*.pm /usr/share/perl5
21 # copy bweb perl program to you cgi location
22 mkdir -m 755 /usr/lib/cgi-bin/bweb
23 install -m 755 -o root -g root bweb/cgi/*.pl /usr/lib/cgi-bin/bweb
26 mkdir -m 750 /etc/bweb
27 chown root:www-data /etc/bweb
28 echo "template_dir = /usr/share/bweb/tpl" > /etc/bweb/config
29 chown www-data /etc/bweb/config
31 # copy bweb template file
32 mkdir -p /usr/share/bweb/tpl
33 install -m 644 -o root -g root bweb/tpl/*.tpl /usr/share/bweb/tpl
35 # copy bweb graphics elements (bweb elements must reside on /bweb)
37 install -m 644 -o root -g root bweb/html/*.{js,png,css,gif} /var/www/bweb
41 ################ INSTALL PERL LIBRARY ##########################
44 - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql)
50 You can install perl modules with CPAN
54 Or use your distribution
55 apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl
56 apt-get install libdbd-mysql-perl libdbd-pg-perl libdbi-perl
58 ################ APACHE CONFIGURATION ##########################
60 It could be a good idea to protect your bweb installation.
62 Put this in you httpd.conf, and add user with htpasswd
64 <Directory /usr/lib/cgi-bin/bweb>
65 Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
67 AuthName MyPrivateFile
68 AuthUserFile /etc/apache/htpasswd
74 ################ CONFIGURATION #################################
76 /etc/bweb/config look like : (you can edit it inside bweb)
78 dbi = DBI:Pg:database=bacula;host=192.168.1.2
81 template_dir = /usr/share/bweb/tpl
82 graph_font = /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
83 email_media = eric@localhost
84 bconsole = /usr/local/bacula/sbin/bconsole -c /usr/local/bacula/etc/bconsole.conf
86 ################ BRESTORE ######################################
88 If you want to use brestore with bweb, you must associate mime type
89 text/brestore with your brestore.pl.
91 ################ POSTGRESQL NOTES ##############################
93 If you think that Mysql is not a great database (or just a toy), you must add
94 function to the Postgresql bacula database to get Bweb works.
96 psql -u bacula bacula < script/bweb-postgresql.sql
98 ################ BCONSOLE NOTES ################################
100 You must use bconsole without conio/readline support ! You can have 2 bconsole
101 binary at the same time.
103 ./configure <your-other-options> --disable-conio
109 cp bconsole <your_destination>
111 ################ BACULA LOG ####################################
113 To use Bweb log engine, you must apply this little patch and have the
114 new Log table in your database.
116 After, you can fill your database with :
117 tail -f /tmp/log.sql | bacula -u bacula bacula
120 patch < message.patch
121 --- cvs/src/lib/message.c 2006-07-27 21:06:20.000000000 +0200
122 +++ cvs/src/lib/message.c.director 2006-07-28 13:46:49.171083494 +0200
127 + void db_escape_string(char *snew, char *old, int len);
130 + POOL_MEM cmd(PM_MESSAGE);
131 + int len = strlen(msg);
132 + char *p = (char *)malloc(len * 2 + 1);
133 + db_escape_string(p, msg, len);
134 + FILE *fp = fopen("/tmp/log.sql", "a");
135 + fprintf(fp, "INSERT INTO Log (Time, JobId, LogText) VALUES (NOW(),%s, '%s');\n", edit_int64(jcr->JobId, ed1), p);
141 Dmsg1(850, "DIRECTOR for following msg: %s", msg);
146 ################ BWEB LIMITATION ###############################
148 To get bweb working, you must follow these rules
149 - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
150 - AutoChanger name must be same as Storage name device in bacula
152 ################ SUDO CONFIGURATION ############################
154 *** At this time, autochanger module works only at home :)
156 If you use sudo, put this on you /etc/sudoers
158 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *
159 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer status
160 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer load *
161 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer unload *