1. 程式人生 > >webacula安裝部署流程

webacula安裝部署流程

bacula 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  OKCurrent PostgreSQL version = 9.4.14 OKCurrent Sqlite version = 3.7.17 OKCurrent 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"       #建議使用sudobacula.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 requirettyapache 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 productionAlias /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.confMessages {
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/cachevim /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/


本文出自 “Ogre之路” 博客,請務必保留此出處http://ogrecn.blog.51cto.com/12502697/1974569

webacula安裝部署流程