From 6dcb9cd5f7a0c894b6fb06b7c710ebae774a5584 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sat, 18 Jul 2009 21:14:54 +0000 Subject: [PATCH] Add info on bweb + lighttpd git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9055 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/INSTALL | 145 ++++++++++++++++++++++--------------- gui/bweb/script/httpd.conf | 38 ++++++++++ gui/bweb/script/starthttp | 28 +++++++ 3 files changed, 153 insertions(+), 58 deletions(-) create mode 100644 gui/bweb/script/httpd.conf create mode 100755 gui/bweb/script/starthttp diff --git a/gui/bweb/INSTALL b/gui/bweb/INSTALL index b335df8e2b..47a4ce4f97 100644 --- a/gui/bweb/INSTALL +++ b/gui/bweb/INSTALL @@ -5,21 +5,91 @@ Bweb works well with 2.0 release or later. 1) install Perl lib -2) copy your files -3) initialize your configuration file -4) do some sql stuff (for postgresql or mysql 5 users) -5) use the -n option on bconsole so that it works with Expect -6) get bacula log more useful -7) bweb limitation -8) using sudo with autochanger -9) using bfileview.pl -10) accessing to bweb -11) setting mysql read-only account -12) get more statistics -13) use users and groups with bweb -14) setup restoration in bweb - -################ FILE COPY ##################################### +2) using lighttpd +3) copy your files (using apache) +4) initialize your configuration file +5) do some sql stuff (for postgresql or mysql 5 users) +6) use the -n option on bconsole so that it works with Expect +7) get bacula log more useful +8) bweb limitation +9) using sudo with autochanger +10) using bfileview.pl +11) accessing to bweb +12) setting mysql read-only account +13) get more statistics +14) use users and groups with bweb +15) setup restoration in bweb + + +################ INSTALL PERL LIBRARY ########################## + + - perl modules + - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql) + (SQLite is not supported) + - GD::Graph + - GD + - HTML::Template + - CGI + - Expect + - Time::ParseDate + - Date::Calc + + You can install perl modules with CPAN + perl -e shell -MCPAN + > install Expect + + Or use your distribution + apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl \ + libdbd-mysql-perl libdbd-pg-perl libdbi-perl \ + libdate-calc-perl libtime-modules-perl + + Note: the best way to test if you have all the dependencies + fullfilled for Perl is to: + + cd /var/www/cgi-bin/bweb + ./bweb.pl + + you might also want to try: + + ./bgraph.pl + + To make sure the graphing modules are loaded. However, running it + will spray binary graphics data on your terminal. Otherwise, you will + get an error. + + That should show you if any of the pre-requisites are missing. + On SuSE 10.2, I was able to load all the appropriate modules via rpms, + with the exception of Expect and Time::ParseDate, which I loaded manually + using perl. + + If you experience problems, always consult the Apache error_log + file. + + +################# USE LIGHTTPD WITH BWEB ####################### + +In this example, bweb files are in /home/bacula/bweb + +bacula:~$ cd bweb +bacula:~/bweb$ sed -i "s:/etc/bacula/bweb.conf:$PWD/bweb.conf:" lib/Bweb.pm +bacula:~/bweb$ cat > bweb.conf < '$PWD/lang', + fv_write_path => '/tmp/', + }; +EOF + + +# You can start the web server from the bweb directory +bacula@localhost:~/bweb$ ./script/starthttp + Using bweb on /home/eric/dev/git/gui/bweb, use firefox http://localhost:9180 + 2009-07-18 22:23:12: (log.c.75) server started + + +By default, only the loopback interface is binded, you can change that +in the bweb/script/httpd.conf file. + + +################ FILE COPY (Full Apache methode) ############### # you must get bweb svn files svn checkout https://bacula.svn.sourceforge.net/svnroot/bacula/trunk/gui/bweb bweb @@ -38,6 +108,8 @@ Bweb works well with 2.0 release or later. # or install -m 644 -o root -g root bweb/lib/*.pm /usr/share/perl5 + + # copy the bweb perl program to your cgi location mkdir -m 755 /usr/lib/cgi-bin/bweb install -m 755 -o root -g root bweb/cgi/*.pl /usr/lib/cgi-bin/bweb @@ -67,49 +139,6 @@ Bweb works well with 2.0 release or later. Simply copy lang/fr/tpl/*.tpl files to .../tpl/fr/*.tpl and choose your language in the configuration panel. -################ INSTALL PERL LIBRARY ########################## - - - perl modules - - DBI (with mysql or postgresql support DBD::Pg and DBD::mysql) - (SQLite is not supported) - - GD::Graph - - GD - - HTML::Template - - CGI - - Expect - - Time::ParseDate - - Date::Calc - - You can install perl modules with CPAN - perl -e shell -MCPAN - > install Expect - - Or use your distribution - apt-get install libgd-graph-perl libhtml-template-perl libexpect-perl \ - libdbd-mysql-perl libdbd-pg-perl libdbi-perl \ - libdate-calc-perl libtime-modules-perl - - Note: the best way to test if you have all the dependencies - fullfilled for Perl is to: - - cd /var/www/cgi-bin/bweb - ./bweb.pl - - you might also want to try: - - ./bgraph.pl - - To make sure the graphing modules are loaded. However, running it - will spray binary graphics data on your terminal. Otherwise, you will - get an error. - - That should show you if any of the pre-requisites are missing. - On SuSE 10.2, I was able to load all the appropriate modules via rpms, - with the exception of Expect and Time::ParseDate, which I loaded manually - using perl. - - If you experience problems, always consult the Apache error_log - file. ################ APACHE CONFIGURATION ########################## diff --git a/gui/bweb/script/httpd.conf b/gui/bweb/script/httpd.conf new file mode 100644 index 0000000000..d67026a5c9 --- /dev/null +++ b/gui/bweb/script/httpd.conf @@ -0,0 +1,38 @@ +################################################################ +# lighttpd configuration example for bweb +# bacula@localhost:~$ lighttpd -f script/httpd.conf +# firefox http://localhost:9180 +################################################################ + +server.bind = "localhost" +server.port = 9180 + +################################################################ + +var.basedir = env.BWEBBASE + +server.modules = ("mod_cgi", "mod_alias", "mod_setenv") +server.document-root = basedir + "/html/" + +cgi.assign = ( ".pl" => "/usr/bin/perl" ) +alias.url = ( "/cgi-bin/bweb/" => basedir + "/cgi/", + "/bweb/fv/" => "/tmp/", + "/bweb" => basedir + "/html/", + ) + +setenv.add-environment = ( + "PERLLIB" => basedir + "/lib/" +) + +index-file.names = ( "index.html" ) + +mimetype.assign = ( +".html" => "text/html", +".gif" => "image/gif", +".jpeg" => "image/jpeg", +".jpg" => "image/jpeg", +".png" => "image/png", +".ico" => "image/x-icon", +".css" => "text/css", +".js" => "application/javascript", +) diff --git a/gui/bweb/script/starthttp b/gui/bweb/script/starthttp new file mode 100755 index 0000000000..06e4b42429 --- /dev/null +++ b/gui/bweb/script/starthttp @@ -0,0 +1,28 @@ +#!/bin/sh + +# start bweb with lighttpd + +BASE=$(dirname $0) + +if [ -f $PWD/html/bweb.js ]; then + BWEBBASE=$PWD + +elif [ -f $PWD/../html/bweb.js ]; then + BWEBBASE=$(dirname $PWD) + +elif [ -f $BASE/html/bweb.js ]; then + BWEBBASE=$BASE + +else + echo "Can't determine bweb installation directory" + exit 1 +fi + +host=$(awk -F'"' '/bind/ { print $2 }' $BWEBBASE/script/httpd.conf) +port=$(awk '/port/ { print $3 }' $BWEBBASE/script/httpd.conf) + +echo "Using bweb on $BWEBBASE, use firefox http://$host:$port" +export BWEBBASE +export PERL5LIB=$BWEBBASE/lib + +lighttpd -f $BWEBBASE/script/httpd.conf -- 2.39.5