webacula安装部署流程

以webacula-7.0.0为例 建议安装在os6上

下载webcaula

http://webacula.sourceforge.net/#downloads

安装和配置

安装要求

1、Bacula 3.0 或以上版本

2、系统安装有 Mysql,PostgreSQL 或 SQlite 数据库

3、Zend Framework 1.8.3 或更高版本
PHP 5.2.4 或更高版本,并安装 php-gd、php-pdo、php-dom、php-xml、php-mysql 及 php-pgsql 包

# yum install -y httpd php php-gd php-common php-pdo php-pgsql php-mysql php-mbstring php-bcmath php-xml

检查是否符合安装要求

# cd webacula-7.0.0 
# cd install/ 
# ./check_system_requirements.php

显示:sh: psql: 未找到命令
没有安装postgreSQL

安装postgreSQL

# yum install -y https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm
# yum install -y postgresql94 postgresql94-server

再次检查是否符合安装要求

# ./check_system_requirements.php 

Webacula check System Requirements...

Current MySQL version = 5.5.56	OK
Current PostgreSQL version = 9.4.14	OK
Current Sqlite version = 3.7.17	OK

Current PHP version = 5.4.16	OK

php pdo installed.	OK
php gd installed.	OK
php xml installed.	OK
php dom installed.	OK

php pdo_mysql installed.	OK
php pdo_pgsql installed.	OK
php pdo_sqlite installed.	OK
php-dom, php-xml installed.	OK

安装 ZendFramework,并拷贝文件

下载Zend Framework 1.12.17 Minimal

http://www.zend.com/en/company/community/framework/downloads#Linux

解压缩

# tar -zxvf ZendFramework-1.12.17-minimal.tar.gz

将ZendFramework/library/Zend 目录拷贝到 webacula/library 目录下

# cp -R /root/ZendFramework-1.12.17-minimal/library/ /root/webacula-7.0.0/

然后将 webacula 目录拷贝到 apache的发布目录,并更名为webacula

# cp -R /root/webacula-7.0.0 /var/www/webacula

修改Mysql的root登陆密码(否则在执行下面的mysql 脚本时候 会报错)

mysql> set password for root@localhost = password('dr123');
# 密码需要跟配置里面的数据库密码一致(config.ini db.conf)

编辑 webacula 的 config.ini 文件

需要修改的内容如下

# cd /var/www/webacula/application/
# vim config.ini 
db.adapter = PDO_MYSQL 
db.config.host = localhost 
db.config.username = root 
;;your database password 
db.config.password = "dr123"  ;;	#这个密码是Mysql的root的密码。
db.config.dbname = bacula 
bacula.sudo = "/usr/bin/sudo"		#建议使用sudo
bacula.bconsole = "/opt/bacula/sbin/bconsole"   ;; 

添加 apache 用户权限

# groupadd bacula
# usermod -aG bacula apache

# chown root:bacula /opt/bacula/sbin/bconsole
# chown root:bacula /opt/bacula/etc/bconsole.conf
# chmod u=rwx,g=rx,o= /opt/bacula/sbin/bconsole
# chmod u=rwx,g=rx,o= /opt/bacula/etc/bconsole.conf

# visudo	#编辑sudo权限 添加apache权限

# Defaults requiretty
apache ALL=NOPASSWD: /opt/bacula/sbin/bconsole

拷贝webacula配置文件到apache 并编辑配置文件

# cp /root/webacula-7.0.0/install/apache/webacula.conf /etc/httpd/conf.d/
# vim /etc/httpd/conf.d/webacula.conf

LoadModule rewrite_module modules/mod_rewrite.so
SetEnv APPLICATION_ENV production
Alias /webacula  /var/www/webacula/html     #需要更改成webacula所在的地址
<Directory /var/www/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 10.0.0.0/255.255.255.0        #允许登陆webacula的IP网段
   Allow from ::1
   #
   # change the settings below
   #
   # Allow from <your network>
</Directory>
<Directory /var/www/webacula/docs>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/application>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/languages>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/library>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/install>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/tests>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/webacula/data>
   Order deny,allow
   Deny from all
</Directory>
<Directory /var/www/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 10.0.0.0/255.255.255.0        #允许登陆webacula测试地址的IP网段
   Allow from ::1
   #
   # change the settings below
   #
   # Allow from <your network>
</Directory>

编辑 php 配置文件

vim /etc/php.ini

memory_limit = 32M 
max_execution_time = 3600

编辑bacula-dir.conf文件 并重启bacula服务

# vim /opt/bacula/etc/bacula-dir.conf

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

设置数据库连接设置及webacula登录用户名密码

# cd /var/www/webacula/install/
# vim db.conf

# See also application/config.ini 

# bacula settings 
db_name="bacula"      
# for Sqlite only 
db_name_sqlite="/usr/local/bacula/bin/working/bacula.db" 
db_user="root"              #数据库root登陆名 

# !!! CHANGE_THIS !!! 
db_pwd="dr123"              #Mysql的root密码 

# Webacula web interface settings 
# 
# Built-in superuser login is 'root' 
# 
# !!! CHANGE_THIS !!!
# Use
#       ./password-to-hash.php <password>
# and insert the resulting hash below         #这个密码要先运行./password-to-hash.php <password> ,如 ./password-to-hash.php dr123,将结果写到这里。 
webacula_root_pwd="$P$BWMY1REK18VlkYh7jWqtSfj0uOrB561"          #复制生成的密码

更改cache文件夹权限、修改index.php文件(否则会报错服务起不来)

chmod 777 /var/www/webacula/data/cache

vim /var/www/webacula/html/index.php
# 修改/var/www/webacula/html/index.php 中的 define('BACULA_VERSION', 14); 将14改为15

执行 mysql 脚本

# cd /var/www/webacula/install/MySql/
#./10_make_tables.sh
#./20_acl_make_tables.sh

重启服务 添加httpd自启动

# service mysqld restart
# service httpd start
# chkconfig httpd on

访问webacula

使用(root:dr123)登录Webacula

http://localhost/webacula/
原文地址:https://www.cnblogs.com/ogrecn/p/7692098.html