The Bacuview application has been developed using the Ruby on Rails framework, as described at the Ruby on Rails web site. While this greatly speeds development, it adds a few prerequisites to the application. The installation procedure involves installing Ruby, using Ruby to build RubyGems, the Ruby package manager, and finally using the resulting gem command to install the Ruby on Rails package and the Bacuview application. After a few configuration file changes your Bacuview installation should be operational.
It's best to install as much of the required software using the packaging system provided by your operating system. For Fedora Core 6 and derived operating systems, this should cover all the bases:
$ su - # yum install ruby ruby-rdoc ruby-postgres ruby-mysql
Of course, you could also simply "yum install \*ruby\*" to get all the Ruby goodness that Fedora has to offer, while at the other extreme you could omit either ruby-postgress or ruby-mysql.
RubyGems, the Ruby package manager is installed next. The RubyGems application is distributed as a tar file containing a "setup.rb" Ruby script that handles the RubyGems installation and setup. As with Ruby itself, rubygems is available for download from the rubyforge.org web site.
Given the rubygems-0.9.0.tgz file...
$ tar xzf rubygems-0.9.0.tgz $ su - # cd rubygems-0.9.0 # ruby setup.rb
With the RubyGems package available, the installation of the Bacuview web application and the Ruby on Rails framework that it uses is trivial:
# gem install rails --include-dependencies # gem install bacuview
While strictly optional, you can protect your bacula database against inadvertent modification by the Bacuview application by setting up a "bacuview" database user that has select-only rights to the few tables that the Bacuview application uses. As the postgres user, or whatever user has administrative rights to your database:
$ psql bacula # create user bacuview password 'bacuview'; # grant select on job, jobmedia, client, media, pool to bacuview;
It may also be necessary to add lines to the pg_hba.conf file to allow the bacuview user to connect to the bacula database:
local bacula bacuview md5 host bacula bacuview 127.0.0.1/32 md5
Local configurations are performed through two configuration files, config/database.yml and bacuview/custom.yml. Begin by copying over the supplied template files:
# cd /usr/lib/ruby/gems/1.8/gems/bacuview/config # cp database.yml.template database.yml # cp bacuview.yml.template bacuview.yml
The database.yml file is initially set up for a Postgres database running on the local machine, accessing a database instance named bacula and accessed by the bacuview user with a password of bacuview. For a MySQL database, use 'adapter: mysql', and edit the other parameters appropriately.
The bacuview.yml file is currently used only to allow Bacuview to find the Bacula configuration files so that the mapping between client names and host names can be extracted for use by the client status check. If these are kept in /etc/bacula, no changes should be required.
The simplest way to run the Baculview application is to use WEBrick, the web server supplied with the Rails framework. In the gem installation, /usr/bin/bacuview is a simple wrapper script that runs the WEBrick server:
$ /usr/sbin/bacuview => Booting WEBrick... => Rails application started on http://0.0.0.0:3000
If all is well, you should be able to access the initial Bacuview web page by pointing your web browser to the URL shown in the server startup message, http://0.0.0.0:3000
If so, congratulations, and welcome to Bacuview!
Once you're satisfied that all is well, you may want to switch to the Bacuview production environment, which is slightly faster and which gives less informative error messages. You may also want to run the server as a daemon, and to use a more standard web server port. This can be done by passing options when starting the web server:
$ bacuview -d -e production -p 8080