]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/bweb/INSTALL
ebl info about get cvs files
[bacula/bacula] / gui / bweb / INSTALL
index 9c5317e424a9e923c1d7b14caa15817be199a1cc..01c4f27efb3fcc2a411b8cf2b7404848788b8582 100644 (file)
@@ -14,6 +14,10 @@ Bweb works well with 1.39 release.
 8) using sudo with autochanger
 
 ################ FILE COPY #####################################
+ # you must get bweb cvs files
+ cvs -d:pserver:anonymous@bacula.cvs.sourceforge.net:/cvsroot/bacula login 
+ cvs -z3 -d:pserver:anonymous@bacula.cvs.sourceforge.net:/cvsroot/bacula co -P gui
+ cd gui
 
  # first, copy bweb perl librarie in your PERL5 INC path
  install -m 644 -o root -g root  bweb/lib/*.pm /usr/share/perl5
@@ -25,7 +29,7 @@ Bweb works well with 1.39 release.
  # get a config file
  mkdir -m 750 /etc/bweb
  chown root:www-data /etc/bweb
- echo "template_dir = /usr/share/bweb/tpl" > /etc/bweb/config
+ echo '$VAR1 = { template_dir => "/usr/share/bweb/tpl" };' > /etc/bweb/config
  chown www-data /etc/bweb/config
 
  # copy bweb template file
@@ -34,10 +38,13 @@ Bweb works well with 1.39 release.
 
  # copy bweb graphics elements (bweb elements must reside on /bweb)
  mkdir /var/www/bweb
- install -m 644 -o root -g root  bweb/html/*.{js,png,css,gif} /var/www/bweb
+ install -m 644 -o root -g root  bweb/html/*.{js,png,css,gif,ico} /var/www/bweb
 
  # done !
 
+ WARNING : Your www-data user must be able to execute bconsole and able to read bconsole.conf !
+           You can create an bconsole group for that.
+
 ################ INSTALL PERL LIBRARY ##########################
 
  - perl modules
@@ -73,15 +80,44 @@ Put this in you httpd.conf, and add user with htpasswd
 
 ################ CONFIGURATION #################################
 
-/etc/bweb/config look like : (you can edit it inside bweb)
+/etc/bweb/config looks like : (you can edit it inside bweb)
+$VAR1 = bless( {
+  'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
+  'name' => undef,
+  'config_file' => '/etc/bweb/config',
+  'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
+  'ach_list' => {
+     'S1_L80' => bless( {
+         'info' => {
+                     'drive' => 0,
+                     'io' => 0,
+                     'slot' => 0
+                   },
+         'name' => 'S1_L80',
+         'bweb' => undef,
+         'device' => '/dev/changer',
+         'drive' => [],
+         'debug' => 0,
+         'label' => {},
+         'precmd' => 'sudo',
+         'io' => [],
+         'mtxcmd' => '/usr/sbin/mtx',
+         'drive_name' => [
+                           'S1_L80_SDLT0',
+                           'S1_L80_SDLT1'
+                         ],
+         'slot' => []
+       }, 'Bweb::Autochanger' )
+   },
+  'password' => 'xxx',
+  'template_dir' => '/usr/share/bweb/tpl',
+  'dbi' => 'DBI:mysql:database=bacula',
+  'error' => '',
+  'debug' => 0,
+  'user' => 'bacula',
+  'email_media' => 'eric@localhost'
+}, 'Bweb::Config' );
 
-dbi = DBI:Pg:database=bacula;host=192.168.1.2
-user = bacula
-password = test
-template_dir = /usr/share/bweb/tpl
-graph_font = /usr/share/fonts/truetype/msttcorefonts/Arial.ttf
-email_media = eric@localhost
-bconsole = /usr/local/bacula/sbin/bconsole -c /usr/local/bacula/etc/bconsole.conf
 
 ################ BRESTORE ######################################
 
@@ -97,16 +133,8 @@ psql -u bacula bacula < script/bweb-postgresql.sql
 
 ################ BCONSOLE NOTES ################################
 
-You must use bconsole without conio/readline support ! You can have 2 bconsole
-binary at the same time.
-
-./configure <your-other-options> --disable-conio
-cd src/lib
-make
-cd ..
-cd console
-make
-cp bconsole <your_destination>
+You must use bconsole without conio/readline support. For that, use
+bconsole -n option.
 
 ################ BACULA LOG ####################################
 
@@ -114,13 +142,15 @@ To use Bweb log engine, you must apply this little patch and have the
 new Log table in your database.
 
 After, you can fill your database with :
-tail -f /tmp/log.sql | bacula -u bacula bacula
+while true; do
+       tail -f /tmp/log.sql | bacula -u bacula bacula
+done
 
 cd bacula-src
-patch < message.patch
+patch -p1 < message.patch
 --- cvs/src/lib/message.c       2006-07-27 21:06:20.000000000 +0200
 +++ cvs/src/lib/message.c.director      2006-07-28 13:46:49.171083494 +0200
-@@ -716,6 +716,18 @@
+@@ -716,6 +716,20 @@
                  }
                  fputs(dt, d->fd);
                  fputs(msg, d->fd);
@@ -132,8 +162,10 @@ patch < message.patch
 +                       char *p = (char *)malloc(len * 2 + 1);
 +                       db_escape_string(p, msg, len);
 +                       FILE *fp = fopen("/tmp/log.sql", "a");
-+                       fprintf(fp, "INSERT INTO Log (Time, JobId, LogText) VALUES (NOW(),%s, '%s');\n", edit_int64(jcr->JobId, ed1), p);
-+                       fclose(fp);
++                       if (fp) {
++                          fprintf(fp, "INSERT INTO Log (Time, JobId, LogText) VALUES (Now(), %s, '%s');\n", edit_int64(jcr->JobId, ed1), p);
++                          fclose(fp);
++                       }
 +               }
 +
                  break;
@@ -141,18 +173,17 @@ patch < message.patch
                  Dmsg1(850, "DIRECTOR for following msg: %s", msg);
 
 
-
+This patch is only for director, this will breaks the rest.
+you can revert it with patch -p1 -R < message.patch
 
 ################ BWEB LIMITATION ###############################
 
 To get bweb working, you must follow these rules
  - Media, Storage and Pool must have [A-Za-z_0-9\.-]+ (no space)
- - AutoChanger name must be same as Storage name device in bacula
+ - AutoChanger name must be same as Device and Location name in bacula
 
 ################ SUDO CONFIGURATION ############################
 
-*** At this time, autochanger module works only at home :)
-
 If you use sudo, put this on you /etc/sudoers
 
 www-data ALL = (root) NOPASSWD: /usr/sbin/mtx -f /dev/changer transfer *