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

来源:互联网 发布:自己淘宝标志设计 编辑:程序博客网 时间:2024/06/03 17: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.gzcd 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-everywheresource 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/workingmake && 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 composerWith postgreSQL support$ sudo apt-get install apache2 libapache2-mod-php5 php5-pgsqlWith SQLite support$ sudo apt-get install apache2 libapache2-mod-php5 php5-sqlite

配置php

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

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

配置nginx

htpasswd -c /etc/nginx/htpasswd.users admin修改/etc/nginx/sites-available/defaultserver {    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-webcd bacula-webtar xvf ../bacula-web-*.tgz

配置bacula-web后台

cd application/config/cp config.php.sample config.phpvi 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/htmlrm -f index.htmlmv /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 composercomposer install

问题2:

connect() to unix:/var/run/php5-fpm.sock failed解决办法:apt install php5-fpm/etc/init.d/php5 restart
原创粉丝点击