开源bacula9.0.4 基于ubuntu16.04安装

一.Bacula介绍
Bacula是一款开源的跨平台网络备份工具,提供基于企业级的CS的备份解决方案。可以对数据进行备份、恢复、以及完整性校验。一个完整的bacula备份系统,由下面5个部分组成
Director Daemon:负责监听所有的备份、恢复、验证、存档事务,以及定制备份和恢复文件计划等,并将整个系统运行状况记录在一个数据库文件中。其配置文件为bacula-dir.conf。
Storage Daemon(SD):主要负责将数据备份到存储介质上,而在数据恢复时,负责将数据从存储介质中传送出去。其配置文件为bacula-sd.conf。
File Daemon(FD):安装在需要备份数据的机器上的守护进程,在备份数据时,它负责把文件传出,在恢复数据时负责接收数据并执行恢复操作。配置文件为bacula-fd.conf。
Console:管理控制台。可以通过这个控制台连接到Director Daemon进行管理备份与恢复操作。
Monitor:进程监控端。
二.前置条件
基于ubuntu16.04安装

三.安装部署
获取bacula安装包 bacula-9.0.4.tar.gz
解压安装:

tar xvf bacula-9.0.4.tar.gz
cd bacula-9.0.4.tar.gz
获取qt4 并将qt4源码目录移至bacula主目录下
cp -r depkgs-qt /root/bacula/

安装编译依赖文件:

apt install libx11-dev mysql mysql-server libmysql++-dev libattr1 libattr1-dev libacl1 libacl1-dev  libauthen-pam-perl apt-show-versions lua-dbi-mysql lua-dbi-mysql-dev libdbd libdbd-dev

继续编译:

cd depkgs;
./configure-qt4 qt-everywhere-
./build-qt4 qt-everywhere
source qt4-path

安装完qt,接下来安装编译bacula

 CFLAGS="-g -Wall";export CFLAGS;./configure --sbindir=/opt/bacula/bin --sysconfdir=/opt/bacula/bin --mandir=/opt/bacula/bin --enable-smartalloc  --enable-bat --with-pid-dir=/opt/bacula/bin/working --with-subsys-dir=/opt/bacula/bin/working --with-mysql  --with-working-dir=/opt/bacula/bin/working
make && make install

安装完bacula,接着安装webmin和bacula-web。
安装web-min
到对应网址下载:[https://sourceforge.net/projects/webadmin/files/webmin/]

dpkg -i webmin-*

打开浏览器:输入 IP:10000即可访问。

安装bacula-web

Install Apache and PHP

With MySQL support

$ sudo apt-get install nginx apache2-utils php5-fpm php5-mysql php5-gd composer

With postgreSQL support

$ sudo apt-get install apache2 libapache2-mod-php5 php5-pgsql

With SQLite support

$ sudo apt-get install apache2 libapache2-mod-php5 php5-sqlite

配置php

vi /etc/php5/fpm/php.ini
cgi.fix_pathinfo=0
date.timezone = America/New_York

重启php5-fpm:/etc/init.d/php-fpm restart

配置nginx

htpasswd -c /etc/nginx/htpasswd.users admin
修改/etc/nginx/sites-available/default
server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /usr/share/nginx/html;
    index index.php index.html index.htm;

    **server_name server_domain_name_or_IP**;替换成对应IP地址

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location / {
        try_files $uri $uri/ =404;
    }

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

重启nginx : /etc/init.d/nginx restart

下载bacula-web

 cd /work
 curl -O http://www.bacula-web.org/files/bacula-web.org/downloads/bacula-web-latest.tgz
 mkdir bacula-web
cd bacula-web
tar xvf ../bacula-web-*.tgz

配置bacula-web后台

cd application/config/
cp config.php.sample config.php
vi config.php

$config[0]['label'] = 'Backup Server';
$config[0]['host'] = 'localhost';
$config[0]['login'] = 'root';
$config[0]['password'] = 'bacula-db-pass';
$config[0]['db_name'] = 'bacula';
$config[0]['db_type'] = 'mysql';
$config[0]['db_port'] = '3306';

配置nginx && bacula-web

cd /usr/share/nginx/html
rm -f index.html
mv /work/bacula-web/* ./
chown -R www-data: *

至此,bacula-web安装配置完成。
bacula-web安装完成后,使用web登录过程中可能会遇到以下问题:

问题1:

require_once(): Failed opening required 'vendor/autoload.php' 
解决办法:cd /usr/share/nginx/html/
apt install composer
composer install

问题2:

connect() to unix:/var/run/php5-fpm.sock failed
解决办法:apt install php5-fpm
/etc/init.d/php5 restart
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值