Install Bareos 18.2 and webui in Fedora 29 Server

Thanks to @jackson over at linuxhelp.com, with a couple of tweaks, I was able to install Bareos 18.2 on Fedora 28 Server.   Here is the original article: https://www.linuxhelp.com/how-to-install-bareos-in-centos

You’re choice of a VM or bare metal machine.  I choose VMware ESXi with a tiny VM and 2 CPU, 8/16GB.

Machine name: BareosServer
All passwords: bareos

Install and Initialize mysql

Note: At the ‘Enter current password for root (enter for none):‘ prompt, hit Enter. Then enter a password and confirm. Answer ‘Y’ to all proceeding questions.

# dnf install -y mariadb-server 
# systemctl start mariadb 
# systemctl enable mariadb
# mysql_secure_installation 

Add the Bareos repository

[bareos_bareos-18.2]
name=bareos bareos-18.2 (Fedora_28)
type=rpm-md
baseurl=http://download.bareos.org/bareos/release/18.2/Fedora_28/
gpgcheck=1
gpgkey=http://download.bareos.org/bareos/release/18.2/Fedora_28/repodata/repomd.xml.key
enabled=1

# vi /etc/yum.repos.d/bareos.repo

Install Bareos

# dnf install -y bareos bareos-database-mysql 

Edit mysql config so root can run scripts

Note: Add the following to the end of my.cnf

[client]
host=localhost
user=root
password=”bareos”

# vi /etc/my.cnf 

Run scripts to create Bareos database, tables, & privileges

NOTE: On another installation, I had a problem running the scripts: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
The fix was to edit each script and credentials. Change: ‘mysql ‘ to ‘mysql -u root -pbareos is whatever follows mysql

# cd /usr/lib/bareos/scripts
# ./create_bareos_database
# ./make_bareos_tables 
# ./grant_bareos_privileges

Start Bareos processes

# systemctl start bareos-dir
# systemctl start bareos-sd
# systemctl start bareos-fd 

Verify process are listening

Note: Three entries should be present: 9101, 9102, 9103

# netstat -an | grep ":910"

Enable processes

# systemctl enable bareos-dir 
# systemctl enable bareos-sd 
# systemctl enable bareos-fd 

Enable the process for selinux

# setsebool -P httpd_can_network_connect on

Add exceptions to the firewall

# firewall-cmd --permanent --add-port=9101-9103/tcp 
# firewall-cmd --permanent --add-port=80/tcp 
# firewall-cmd --reload

Test Director

Note: quit to exit

# bconsole

Install Apache

# dnf install -y httpd php php-cli php-common
# dnf install -y bareos-webui

Enable Bareos console/web login

Note: Add the following to the bottom to the file. Type it. Copy & Paste inserts the wrong quotes.

Console {
  Name = root
  Password = “bareos”
  Profile = “webui-admin”
}

# vi /etc/bareos/bareos-dir.d/console/bareos-mon.conf

Backing up Windows Clients

The default Bareos config backups up LInux clients just fine.  You’ll need to create new: fileset/SelfTest.conf; fileset/Windows All Drives; job/backup*; job/RestoreFiles; jobdefs/DefaultJob;

Once I sanitize a working set, I’ll upload the package here.

Enable Statistics Collection

Add the following to Storage in bareos-sd.conf:

Storage {

  Collect Device Statistics = yes
  Collect Job Statistics = yes
  Statistics Collect Interval = 60
}

# vi /etc/bareos/bareos-sd.d/storage/bareos-sd.conf

Add the following to Device in FileStorage.conf:

Device {

  Collect Statistics = yes
}

# vi /etc/bareos/bareos-sd.d/device/FileStorage.conf

Restart Apache & Director

# systemctl enable httpd
# systemctl restart httpd
# systemctl restart bareos-dir

Lookup the IP address

# ifconfig

Add the IP address to the hosts file

Note: You’ll also need to enter your client addresses and names

192.168.1.xxx     BareosServer
192.168.1.101     client1
192.168.1.102     client2
192.168.1.103     client3
192.168.1.104     client4

# vi /etc/hosts

On each client machine

  • In the hosts file (Windows and Linux) add the client and BareosServer IP Addresses
  • Windows hosts: C:\Windows\System32\drivers\etc\hosts
  • Linux hosts: /etc/hosts
  • Install fd (File Director)
  • Open firewall ports 9102,9103

Open a web browser and navigate to:

http://BareosServer/bareos-webui/director/
Name: root
Password: bareos

Enable disk compression:

First, add modules to the kernel:

# modprobe lz4 lz4_compress

Second, create the file and add this line:

# echo 'add_drivers+="lz4 lz4_compress"' > /etc/dracut.conf.d/lz4.conf

Third, create a new ramdisk

# dracut --regenerate-all --force

If you have a system with low RAM, you may want to also enable zswap

# echo lz4 > /sys/module/zswap/parameters/compressor
# echo 20 > /sys/module/zswap/parameters/max_pool_percent
# echo 1 > /sys/module/zswap/parameters/enabled

Leave a Reply