]> git.sur5r.net Git - bacula/bacula/blob - gui/bweb/install_bweb
Update install doc
[bacula/bacula] / gui / bweb / install_bweb
1 #!/bin/sh
2 #
3 # Change the following four environment variables to suit your system
4 #   Note, the configuration below works on a stock SuSE 10.2 system
5 #
6 # Root directory of web files       
7 #
8 WEB_DIR=/srv/www/htdocs 
9 #
10 # share directory for programs
11 #
12 SHARE_DIR=/usr/share
13 #
14 # cgi_bin location for web server
15 #
16 CGI_BIN=/srv/www/cgi-bin
17 #
18 # Userid the web server is running under
19 #
20 HTTP_USER=wwwrun
21 HTTP_GROUP=www
22
23 # Bacula database name and password
24 DB=bacula
25 DB_PW=""
26 EMAIL_ADDR="xxx@localhost"
27 MTX="/sbin/mtx"
28
29 if [ `whoami` != "root" ] ; then
30   echo "You must be root to run this script."
31   exit 1
32 fi
33
34 #
35 # Normally you should not need to change the following
36 #
37 # first, copy the bweb perl library into your PERL5 INC path
38 perl Makefile.PL
39 make install
40
41 # copy the bweb perl program to your cgi location
42 if [ ! -d ${CGI_BIN}/bweb ] ; then
43    mkdir -m 755 ${CGI_BIN}/bweb
44 fi
45 install -m 755 -o root -g root  cgi/*.pl ${CGI_BIN}/bweb
46
47 # get a config file
48 if [ ! -d /etc/bacula ] ; then
49    mkdir -m 755 /etc/bacula
50    chown root:bacula /etc/bacula
51 fi
52
53 # Setup a default /etc/bacula/bweb.conf
54 cat > /etc/bacula/bweb.conf <<END_OF_DATA
55 \$VAR1 = bless( {
56   'graph_font' => '/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf',
57   'name' => undef,
58   'config_file' => '/etc/bacula/bweb.conf',
59   'bconsole' => '/usr/sbin/bconsole -n -c /etc/bacula/bconsole.conf',
60   'ach_list' => {
61      'S1_L80' => bless( {
62          'info' => {
63                      'drive' => 0,
64                      'io' => 0,
65                      'slot' => 0
66                    },
67          'name' => 'S1_L80',
68          'bweb' => undef,
69          'device' => '/dev/changer',
70          'drive' => [],
71          'debug' => 0,
72          'label' => {},
73          'precmd' => 'sudo',
74          'io' => [],
75          'mtxcmd' => '${MTX}',
76          'drive_name' => [
77                            'S1_L80_SDLT0',
78                            'S1_L80_SDLT1'
79                          ],
80          'slot' => []
81        }, 'Bweb::Autochanger' )
82    },
83   'password' => '${DB_PW}',
84   'template_dir' => '${SHARE_DIR}/bweb/tpl',
85   'dbi' => 'DBI:mysql:database=bacula',
86   'error' => '',
87   'debug' => 0,
88   'user' => '${DB}',
89   'email_media' => '${EMAIL_ADDR}'
90 }, 'Bweb::Config' );
91 END_OF_DATA
92
93 chown ${HTTP_USER} /etc/bacula/bweb.conf
94
95 # copy the bweb template file
96 if [ ! -d ${SHARE_DIR}/bweb/tpl ] ; then
97    mkdir -p ${SHARE_DIR}/bweb/tpl
98 fi
99 install -m 644 -o root -g root  tpl/*.tpl ${SHARE_DIR}/bweb/tpl
100
101 # copy the bweb graphics elements (bweb elements must reside in /bweb)
102 if [ ! -d ${WEB_DIR} ] ; then
103    mkdir ${WEB_DIR}/bweb
104 fi
105 install -m 644 -o root -g root  html/*.{js,png,css,gif,ico,html} ${WEB_DIR}/bweb
106
107 # done !