Tuesday Aug 06

Webacula installation on Ubuntu

Webacula installation on Ubuntu

AddThis Social Bookmark Button

bacula backup system for Ubuntu

Webacula installation for Ubuntu

Bacula is a backup program enabling you to backup, restore, and verify data across your network

Webacula is a Web interface for the Bacula backup system.

Webacula installation 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

Installation context

  • Webacula version 5.5
  • Ubuntu Karmic Koala (this procedure is suited for Debian as well)

Webacula 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

Website

Webacula directory tree Make the directory tree

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

webacula directory create

 
sudo mkdir /usr/share/webacula/

The resulting tree should look like

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

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.
  • data/session/ Storage for PHP session. Should be available to writing the Web-server and no access through the client Web-browser. 5
  • data/tmp/ This directory which will be saved the le, which contains a list of les to Job restore. This directory and les in it should be available to read from the Bacula Director and to writing from the Web-server. And no access through the client Web-browser.

Webacula 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 = 
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

Webacula security configuration

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

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:
webacula_user_assignation
sudo usermod -aG bacula www-data

Execution rights

Setup bconsole can be executed under Apache webserver.
webacula user rights

 
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 :

webacula zend framework directory creation

 
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 :

webacula symbolic link

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

Webacula Apache configuration

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

Apache configuration file : /etc/apache2/apache.conf

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

#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
Alias /webacula  /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
 

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all

   Order deny,allow
   Deny from all
#
# 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
 

  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.

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 le :

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

and restart Bacula Director.

Webacula database installation Database installation

For MySQL

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

webacula verification Test your installation

 
http://localhost/webacula/

If you enjoyed this tutorial and want to promote it don't hesitate to click on

Tags: bacula , client , directory , webacula , order , deny

Comments

0 #20 Leo 2013-03-26 13:15
Hy,

Can you help me to solve this problem please ?

Warning: include_once(Ze nd/Db/Adapter/Pdf/Mysql.php): failed to open stream: No such file or directory in /usr/share/php/Zend/Loader.php on line 146 Warning: include_once(): Failed opening 'Zend/Db/Adapter/Pdf/Mysql.php' for inclusion (include_path='.:/usr/share/webacula/html/../library:../application/models/:../application/forms/:.:/usr/share/php:/usr/share/pear') in /usr/share/php/Zend/Loader.php on line 146 Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Db/Adapter/Pdf/Mysql.php" does not exist or class "Zend_Db_Adapter _Pdf_Mysql" was not found in the file' in /usr/share/php/Zend/Loader.php:99 Stack trace: #0 /usr/share/php/Zend/Db.php(258): Zend_Loader::lo adClass('Zend_Db_Adapter ...') #1 /usr/share/webacula/html/index.php(113): Zend_Db::factor y('PDF_MYSQL', Array) #2 {main} thrown in /usr/share/php/Zend/Loader.php on line 99
Quote
+1 #19 Pomardako 2013-02-07 18:17
Im login but i have this error :

Fatal error: Uncaught exception 'Zend_Exception' with message 'Fatal error: Can't connect to SQL server' in /var/www/webacula/html/index.php:178
Stack trace:
#0 {main}
thrown in /var/www/webacula/html/index.php on line 178
Quote
0 #18 taher 2013-01-22 10:03
Hello everybody,

Admin there's no file /etc/apache2/apache.conf ???
your webacula apache configuration was in /usr/share/webacula/install/apache/webacula.con !

Have everyone any idea, i'm blocked :cry:
Quote
0 #17 taher 2013-01-15 15:54
hi everybody,
i want to install webacula under ubuntu lucid server 10.04.
I have tried more than times with more howto's, but no one have worked OK with me :sad:
have anyone a good howto with webacula 5.x
thnx :-)
Quote
0 #16 compdoc 2012-11-17 00:09
It says:

sudo mkdir /usr/share/webacula/

The resulting tree should look like:

/var/www/webacula/

huh? I think you mean:

sudo mkdir /var/www/webacula/

yes?
Quote
0 #15 Dawid 2012-05-06 18:42
Or you can simply change password of users in webacula table in mysql database.
It simple md5 of password.


command below change password to "password" for ALL users of webacula

UPDATE `webacula_users ` SET `pwd` = '5f4dcc3b5aa765d61d8327deb882cf99'
Quote
0 #14 Voltron 2012-03-06 07:55
Ozzik you are my hero :lol: It works great I couldn't find any good solution from a few month... But this one is working in 100% THX A LOT
Quote
0 #13 omerta 2012-02-09 21:11
in the config file of apache.conf lack close the "Directory" that is open in the line 15.
Quote
+2 #12 Ozzik 2011-12-08 14:02
Guys, if anyone is still fighting with being unable to login, here's probably what you should do:
My guess is you didn't specify the "webacula_root_p wd" on the last line of the install/db.conf file. So if you don't want to mess with it too much, just drop all the tables starting with "webacula", there are 17 of them. You can do it via phpmyadmin. After that put that password in db.conf and re-run the 2 mysql scripts (10_make_tables.sh and 20_acl_make_tab les.sh). This will recreate the tables and repopulate them, including the damn password. Now you can login with "root" and the password you just assigned.

Couple of notes: this is if you have mysql. Adjust accordingly if you have other DB.
I suggested to just drop the tables because somehow the changed root password still gave me problems. Plus, it is unlikely you have anything to loose, since you couldn't login anyway.
Hope it works for you.
Quote
0 #11 dima 2011-11-03 17:52
Quoting John:
Hi,
I created /usr/share/webacula/ directory, copied the tarball into it, extracted it and got /usr/share/webacula/webacula-5.5.
At what point is /var/www/webacula supposed to magically appear?
If I create it do I use a directory called webacula or webacula-5.5?
Cheers

/var/www/webacula
i cannot login to site - how can i change root password an webacula site. letter not going to me
Quote

Add comment


Security code
Refresh

Java Tutorial on Facebook