From edaaa82f904eef9c47969b31efb993b9e894e24b Mon Sep 17 00:00:00 2001 From: Frank Bergkemper Date: Fri, 18 Sep 2015 12:53:59 +0200 Subject: [PATCH] Documentation updated Signed-off-by: Frank Bergkemper --- doc/INSTALL.md | 273 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 270 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index ec364ab3795..3985bac1b9f 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -218,11 +218,244 @@ dirport = 9101 **Note:** You can add as many directors as you want. -#### Step 6 - SELinux +Now, you are able to login by calling http:///bareos-webui in your browser of choice. -If you do not use SELinux on your system, you can skip this step. +### INSTALLATION FROM SOURCE -To install bareos-webui on a system with SELinux enabled, the following additional step must be performed. +In this example we assume a running Apache2 Webserver with PHP5 and mod_rewrite is already installed and configured properly. + +#### Step 1 - Get the source + +``` +cd /srv/www/htdocs + +git clone https://github.com/bareos/bareos-webui.git +``` + +or + +``` +cd /srv/www/htdocs + +wget https://github.com/bareos/bareos-webui/archive/Release/15.2.1.tar.gz + +tar xf 15.2.1.tar.gz +``` + +#### Step 2 - Get Zend Framework 2 + +If not installed in other ways we get Zend Framework 2 via Composer. +Read more about Composer here: https://getcomposer.org/ + +``` +cd bareos-webui + +./composer.phar install +``` + +#### Step 3 - Configure Apache2 Webserver + +You can for example copy the default configuration file and edit it to your needs. + +``` +cd /etc/apache2/conf.d + +cp /srv/www/htdocs/bareos-webui/install/apache/bareos-webui.conf . + +vim bareos-webui.conf +``` + +In this example it looks like following. + +``` +# +# Bareos WebUI Apache configuration file +# + +# Environment Variable for Application Debugging +# Set to "development" to turn on debugging mode or +# "production" to turn off debugging mode. + + SetEnv "APPLICATION_ENV" "production" + + +Alias /bareos-webui /srv/www/htdocs/bareos-webui/public + + + + Options FollowSymLinks + AllowOverride None + + # Following module checks are only done to support + # Apache 2.2, + # Apache 2.4 with mod_access_compat and + # Apache 2.4 without mod_access_compat + # in the same configuration file. + # Feel free to adapt it to your needs. + + # Apache 2.2 + + Order deny,allow + Allow from all + + + # Apache 2.4 + + + Order deny,allow + + Require all granted + + + + RewriteEngine on + RewriteBase /bareos-webui + 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 + + + +``` + +Restart your Apache Webserver. + +#### Step 4 - Configure the directors + +Create a required configuration file /etc/bareos-webui/directors.ini and edit it to your needs. + +***Note:*** The location and name of the directors.ini is mandatory. + +``` +mkdir /etc/bareos-webui + +cd /etc/bareos-webui + +cp /srv/www/htdocs/bareos-webui/install/directors.ini . + +vim directors.ini +``` + +A basic directors.ini should look similar to this. + +``` +[director121-dir] +enabled = "yes" +diraddress = "10.10.121.100" +dirport = 9101 + +[director122-dir] +enabled = "yes" +diraddress = "10.10.122.100" +dirport = 9101 + +[director123-dir] +enabled = "no" +diraddress = "10.10.123.100" +dirport = 9101 +``` + +#### Step 5 - Create restricted named consoles + +Configure restricted named consoles and reload your director configuration. Those consoles are like user accounts and used by the webui. +Therefore you need need to create for example two files with the following content on the host your director runs on and you want to be +able to connect to via the webui. + +``` +# +# Preparations: +# +# include this configuration file in bareos-dir.conf by +# @/etc/bareos/bareos-dir.d/webui-consoles.conf +# + +# +# Restricted consoles used by bareos-webui +# +Console { + Name = user1 + Password = "user1" + Profile = profile1 +} +Console { + Name = user2 + Password = "user3" + Profile = profile2 +} +Console { + Name = user3 + Password = "user3" + Profile = profile3 +} +``` + +``` +# +# Preparations: +# +# include this configuration file in bareos-dir.conf by +# @/etc/bareos/bareos-dir.d/webui-profiles.conf +# + +# +# bareos-webui profile resources +# +Profile { + Name = profile1 + CommandACL = status, messages, show, version, run, rerun, cancel, .api, .bvfs_*, list, llist, use, restore, .jobs, .filesets, .clients + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} + +Profile { + Name = profile2 + CommandACL = status, messages, show, version, run, rerun, cancel, .api, .bvfs_*, list, llist, use, restore, .jobs, .filesets, .clients + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} + +Profile { + Name = profile3 + CommandACL = status, messages, show, version, run, rerun, cancel, .api, .bvfs_*, list, llist, use, restore, .jobs, .filesets, .clients + Job ACL = *all* + Schedule ACL = *all* + Catalog ACL = *all* + Pool ACL = *all* + Storage ACL = *all* + Client ACL = *all* + FileSet ACL = *all* + Where ACL = *all* +} +``` + +After including both files and reloading the director you are done and able to use the webui. + +Login via your favorite browser by calling: http:///bareos-webui/. + +### ADDITIONAL INFORMATION + +#### SELinux + +To install bareos-webui on a system with SELinux enabled, the following additional step have to be performed. * Allow HTTPD scripts and modules to connect to the network @@ -230,3 +463,37 @@ To install bareos-webui on a system with SELinux enabled, the following addition setsebool -P httpd_can_network_connect on ``` +#### NGINX + +If you want to use bareos-webui on e.g. nginx with php5-fpm a basic working configuration could look like this. + +``` +server { + + listen 9100; + server_name bareos; + root /var/www/bareos-webui/public; + + location / { + index index.php; + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ .php$ { + + include snippets/fastcgi-php.conf; + + # With php5-cgi alone pass the PHP + # scripts to FastCGI server + # listening on 127.0.0.1:9000 + + # fastcgi_pass 127.0.0.1:9000; + + # With php5-fpm: + + fastcgi_pass unix:/var/run/php5-fpm.sock; + + } + +} +```