
Webacula installation on Ubuntu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.java-tutorial.ch/ubuntu/webacula-installation-on-ubuntu
Sébastien Ursini <sursini@gmail.com>
Last Updated on Friday, 01 April 2011 09:57 Friday, 01 April 2011 06:12



Requirement 

     * Bacula binaries installed
     * Zend Framework version 1.10.0 or later
     * PHP 5.2.4 or later with PDO extension active.
     * Apache and mod rewrite. Or equivalent web-server, for example, nginx
       and ngx http rewrite module
     * Installed php-gd package
     * Installed http://php.net/dom for use the RSS feed
     * Browser compatibility: all jQuery UI plugins are tested for IE 6.0+,
       Firefox 3+, Safari 3.1+, Opera 9.6+, Google Chrome

Context 
     * Webacula version 5.5
     * Ubuntu Karmic Koala

    

Features

   The basic features of the program :
     * Bacula and Webacula ACLs (Access Control Lists) implemented. ACLs
       stored in Bacula database in Webacula tables 
     * Full supported MySQL, PostgreSQL and Sqlite databases 
     * Run Job Restore all files or selected files from Job by JobId 
     * Restore the most recent backup for a client 
     * Restore backup for a client before a specified time 
     * Show Timeline for Jobs Mount, umount Storages 
     * Show Jobs which executed with errors Show a condition of your Volumes 
     * Show scheduled Jobs (at 24 hours forward) 
     * Show all running Jobs Show terminated Jobs (executed in last 24
       hours) 
     * Search Jobs on several conditions Web (ajax) terminal to Bacula
       Console The detailed information on Pools, Volumes, Storages and
       Clients Logbook. Logbook - is simple electronic journal of backups. 
     * Records in logbook are insert, modify, delete manually by the
       operator. 
     * Records can contain links (usual web-links on which it is possible to
       click) to Bacula Jobs or links to other records of this logbook. In
       logbook insert records, for example, about Jobs, failures of the
       equipment, supernumerary situations, etc. 
     * RSS feed Multilingual support - standard gettext (*.mo) files. 
     * Currently supported languages: English, French, German, Italian,
       Portuguese Brazil, Russian, Spanish. For web designers : now very easy
       to create new skins Major version number of Webacula will match the
       version number of Bacula

    

Make the directory tree

   Log as root and make the following
   directory /usr/share/webacula/. Copy Webacula distribution to this
   directory.

sudo mkdir /usr/share/webacula/

   The resulting tree should look like 


 /var/www/webacula/
  |-- application
  | |-- controllers
  | |-- models
  | `-- views
  ...
  |-- data
  | `-- cache
  ...
  |-- docs
  |-- install
  |-- html
  |-- languages
  `-- library
  |-- MyClass
  `-- Zend (here is Zend Framework package)
  |-- Acl
  |-- Auth
  |-- Cache
  ...

PHP session is stored in the table "webacula_php_session".

Some directory description:

     * application/ All source code. Should be available to reading for the
       Web- server and no access through the client Web-browser. 
     * html/ Public code. Should be available to reading for the Web-server
       and for the client Web-browser. 
     * data/ IMPORTANT. This directory, subdirectory and les in it must NOT
       be available to access through the client Web-browser. 
     * data/cache/ Cache directory for Zend Cache. Should be available to
       writing the Web-server and no access through the client Web-browser. 



   Configuration

   Specify the parameters to connect to the Catalog database, timezone and
   other in application/config.ini

   Find below my configuration for a MySQL database configuration

 ...
 ;
 ; config.ini
 ; Webacula 5.5
 ;
 [general]
 ;; supported adapters : PDO_MYSQL, PDO_PGSQL, PDO_SQLITE
 db.adapter = PDO_MYSQL
 db.config.host = localhost
 db.config.username = root
 db.config.password = <your database password>
 db.config.dbname = bacula
 ;; see http://www.php.net/timezones
 def.timezone = "UTC"
 ;; if locale undefined, webacula use autodetect
 ;; avaliable locales : en, de, fr, pt_BR, ru, it, es
 ; locale = "en"
 ;; see INSTALL file for details
 bacula.sudo = ""
 bacula.bconsole = "/usr/bin/bconsole"
 bacula.bconsolecmd = "-n -c /etc/bacula/bconsole.conf"
 ...

    1. Define PDF_MYSQL tu use MySql  in the db.adapter parameter. 
    2. Define your database password in db.config.password. 
    3. Remove the sudo command in bacula.sudo (not needed thanks to the
       configuration below) 
    4. Redefine the bconcole bin according to Ubuntu installation of
       bacula. bacula.bconsole parameter should be /usr/bin/bconsole instead
       of  /sbin/bconsole

   Security configuration

   Create system group account (It should be already created) :

 sudo groupadd bacula

   In order to make sure you have proper web access, you must also add the
   web user (www-data) to the bacula group.
   Add apache to group: 

 sudo usermod -aG bacula www-data

    

Execution rights

   Setup bconsole can be executed under Apache webserver.


 chown root:bacula /usr/bin/bconsole
 chmod u=rwx,g=rx,o= /usr/bin/bconsole
 chown root:bacula /etc/bacula/bconsole.conf
 chmod u=rw,g=r,o= /etc/bacula/bconsole.conf

   Configure Zend-Framework

   Install Zend using Synaptic of apt-get

   Remove the preconfigured Zend folder :


 sudo rmdir /usr/share/webacula/library/Zend

   Assuming your Zend framework library has been install
   in /usr/share/php/libzend-framework-php/ 

   Create a symbolic link to the Zend-Framework :

 ln -s /usr/share/php/libzend-framework-php/Zend /usr/share/webacula/library/Zend

Apache

   Configure an alias. If you are using virtual hosts your webacula
   application will be accessible whatever the domain you are using. 

    1. Define the alias name (Line 14)
    2. Put in comment the mod rewrite module if you have it already enabled
       (Line 8)
    3. Define the "Allow from" according to the ip addresses you will use to
       administer your backup system
    4. Edit RewriteBase parameter if necessary.


-----------------------------------------------------------------------------------   
     # Apache conf
     #
     # Webacula - Web interface of a Bacula backup system
     #
     # Allows only localhost by default
     #

[08] #LoadModule rewrite_module modules/mod_rewrite.so
     # AccessFileName .htaccess
     # RewriteLog "/var/log/httpd/mod_rewrite.log"
     # RewriteLogLevel 3
     # SetEnv APPLICATION_ENV development
     SetEnv APPLICATION_ENV production

[14] Alias /webacula  /usr/share/webacula/html

 <Directory /usr/share/webacula/html>
    RewriteEngine On
    RewriteBase   /webacula
    RewriteCond %{REQUEST_FILENAME} -s [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    php_flag magic_quotes_gpc off
    php_flag register_globals off
    Options Indexes FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from localhost
    Allow from ::1
    #
    # change the settings below
    #
    # Allow from <your network>
 <Directory /usr/share/webacula/docs>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/application>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/languages>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/library>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/install>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/tests>
    Order deny,allow
    Deny from all
 </Directory>
 <Directory /usr/share/webacula/data>
    Order deny,allow
    Deny from all
 </Directory>
 #
 # test mod_rewrite
 #
 <Directory /usr/share/webacula/html/test_mod_rewrite>
    RewriteEngine On
    # for test mod_rewrite
    RewriteBase   /webacula/test_mod_rewrite
    RewriteRule ^testlink([^/]*).html$  index.php?testlink=$1 [L]
    php_flag magic_quotes_gpc off
    php_flag register_globals off
    Options Indexes FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from localhost
    Allow from ::1
 </Directory>
-----------------------------------------------------------------------------------   




PHP Configuration

   Increase values in /etc/php.ini :

   memory_limit = 32M
   max_execution_time = 3600

Bacula setup

   To show messages of the Job output, you must make changes in
   bacula-dir.conf file :

   Messages {
      Name = Standard
      ...
      catalog = all, !skipped, !saved
   }

   and restart Bacula Director.



Database installation

   For MySQL

 cd install/MySql
  ./10_make_tables.sh
  ./20_acl_make_tables.sh

Test your installation

 http://localhost/webacula/

