Настройка Bacula была описана в статье Настройка резервного копирования с помощью Bacula
В этой статье написано о установке и настройке WEB-интерфейса для мониторинга
(НЕ УПРАВЛЕНИЯ) Bacula под названием Bacula-Web
1.Установка необходимых пакетов
Ubuntu
1 |
# apt-get install nginx apache2-utils php5-fpm php5-mysql php5-gd |
Centos
1 |
# yum install nginx php php-gd php-gettext php-mysql php-pdo |
2.Настройка PHP-FPM
Ubuntu
1 |
# nano /etc/php5/fpm/php.ini |
1 2 |
cgi.fix_pathinfo=0 date.timezone = Europe/Kiev |
1 |
# egrep -v '(#|;|^$)' /etc/php5/fpm/pool.d/default.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
[nginx] user = nginx group = nginx listen = /var/run/php5-fpm.sock listen.owner = nginx listen.group = nginx listen.mode = 0660 pm = dynamic pm.max_children = 5 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 3 pm.status_path = /status ping.path = /ping ping.response = pong access.log = /var/log/$pool.access.log slowlog = /var/log/$pool.log.slow request_slowlog_timeout = 3 chdir = / catch_workers_output = yes php_flag[display_errors] = off php_admin_value[error_log] = /var/log/fpm-php.nginx.log php_admin_flag[log_errors] = on php_admin_value[memory_limit] = 64M |
1 |
# php5-fpm –t |
1 |
# /etc/init.d/php5-fpm restart |
Centos
1 |
# nano /etc/php.ini |
1 2 |
cgi.fix_pathinfo=0 date.timezone = Europe/Kiev |
1 |
# egrep -v '(#|;|^$)' /etc/php-fpm.d/www.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
[www] listen = /var/run/php5-fpm.sock listen.allowed_clients = 127.0.0.1 listen.owner = nginx listen.group = nginx listen.mode = 0660 user = nginx group = nginx pm = dynamic pm.max_children = 20 pm.start_servers = 1 pm.min_spare_servers = 1 pm.max_spare_servers = 10 pm.max_requests = 500 pm.status_path = /status ping.path = /ping ping.response = pong request_slowlog_timeout = 3s slowlog = /var/log/php-fpm/www-slow.log catch_workers_output = yes php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on php_admin_value[memory_limit] = 64M php_value[session.save_handler] = files php_value[session.save_path] = /var/lib/php/session |
1 |
# php-fpm –t |
1 |
# /etc/init.d/php-fpm restart |
3.Настройка Nginx(приведу пример только хоста по умолчанию)
Ubuntu
1 |
# nano /etc/nginx/conf.d/default.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
server { listen 192.168.1.140:80 default_server; server_name localhost; root /usr/share/nginx/html; location /bacula-web { allow 127.0.0.1; allow 192.168.1.0/24; deny all; 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; } } location / { root /usr/share/nginx/html; try_files $uri $uri/ /index.php?$args; } 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; } location ~ /\.ht { deny all; } location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; allow 192.168.1.0/24; deny all; } location = /favicon.ico { log_not_found off; access_log off; allow all; } location = /robots.txt { access_log off; log_not_found off; } location ~ ^/(status|ping)$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; access_log off; allow 127.0.0.1; allow 192.168.1.0/24; deny all; } } |
Centos
1 |
# nano /etc/nginx/conf.d/default.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
server { listen 192.168.1.140:80 default_server; server_name localhost; root /var/www/html; index index.html index.html index.php; access_log /var/log/nginx/default.log main; location /bacula-web { allow 127.0.0.1; allow 192.168.1.0/24; deny all; index index.php; location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_param SCRIPT_FILENAME $request_filename; } } location / { try_files $uri $uri/ /index.php?$args; } location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; allow 192.168.1.0/24; deny all; } error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ /\.ht { deny all; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } location ~ ^/(status|ping)$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; access_log off; allow 127.0.0.1; allow 192.168.1.0/24; deny all; } location ~\.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } |
3. Установка и настройка Bacula-Web
Ubuntu
1 |
# cd /tmp |
1 |
# wget -O bacula-web.tgz http://www.bacula-web.org/download.html?file=files/bacula-web.org/downloads/bacula-web-7.0.3.tgz |
1 |
# mkdir /usr/share/nginx/html/bacula-web |
1 |
# tar xvfz bacula-web.tgz –C /usr/share/nginx/html/bacula-web/ |
1 |
# rm /tmp/bacula-web.tgz |
1 |
# chown -R nginx /usr/share/nginx/html/bacula-web |
1 |
# cd /usr/share/nginx/html/bacula-web/application/config/ |
1 |
# cp config.php.sample config.php |
Centos
1 |
# cd /tmp |
1 |
# wget -O bacula-web.tgz http://www.bacula-web.org/download.html?file=files/bacula-web.org/downloads/bacula-web-7.0.3.tgz |
1 |
# mkdir /var/www/html/bacula-web |
1 |
# tar xvfz bacula-web.tgz -C /var/www/html/bacula-web/ |
1 |
# rm /tmp/bacula-web.tgz |
1 |
# chown -R nginx /var/www/html/bacula-web |
1 |
# cd /var/www/html/bacula-web/application/config/ |
1 |
# cp config.php.sample config.php |
Настройки подключения к базе данных bacula берем из файла /etc/bacula/bacula-dir.conf
В секции Catalog
1 |
# nano config.php |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php $config['show_inactive_clients'] = true; $config['hide_empty_pools'] = false; $config['jobs_per_page'] = 25; $config['language'] = 'en_US'; $config[0]['label'] = 'Backup Server'; $config[0]['host'] = 'localhost'; $config[0]['login'] = 'bacula'; $config[0]['password'] = 'baculapassword'; $config[0]['db_name'] = 'bacula'; $config[0]['db_type'] = 'mysql'; $config[0]['db_port'] = '3306'; ?> |
Проверяем тестовую страницу Bacula-Web на предмет установления всех зависимостей
http://192.168.1.140/bacula-web/test.php
При необходимости доставляем недостающие модули PHP
После чего обращаемся непосредственно к главной странице
http://192.168.1.140/bacula-web/
Источник:
https://www.digitalocean.com/community/tutorials/how-to-install-bacula-web-on-ubuntu-14-04
http://www.bacula-web.org/docs.html