{"id":5311,"date":"2020-03-28T21:32:20","date_gmt":"2020-03-28T18:32:20","guid":{"rendered":"https:\/\/kifarunix.com\/?p=5311"},"modified":"2024-03-14T19:48:56","modified_gmt":"2024-03-14T16:48:56","slug":"install-and-configure-backuppc-on-centos-8","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-and-configure-backuppc-on-centos-8\/","title":{"rendered":"Install and Configure BackupPC on CentOS 8"},"content":{"rendered":"\n<p>In this guide, we are going learn how to install and configure BackupPC on CentOS 8.&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/backuppc.github.io\/backuppc\/\" target=\"_blank\">BackupPC<\/a>&nbsp;is a high-performance enterprise-grade backup software suite with a web-based frontend that can be used for backing up Linux, Windows and mac OSXs PCs and laptops to a server\u2019s disk.<\/p>\n\n\n\n<p>Some of the features of BackupPC include;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Provides a <strong>web interface<\/strong>&nbsp;which allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.<\/li>\n\n\n\n<li>It supports <strong>Data deduplication<\/strong>: Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I\/O.<\/li>\n\n\n\n<li>It supports data <strong>Compression<\/strong>: Since only new files (not already pooled) need to be compressed, there is only a modest impact on CPU time.<\/li>\n\n\n\n<li>It is <strong>Open-source<\/strong>: BackupPC is hosted on&nbsp;<a href=\"https:\/\/github.com\/backuppc\/backuppc\" target=\"_blank\" rel=\"noopener\">Github<\/a>, and is distributed under a GPL license.<\/li>\n\n\n\n<li>No client-side software is needed.<\/li>\n<\/ul>\n\n\n\n<p>Read more about BackupPC features on <a href=\"https:\/\/backuppc.github.io\/backuppc\/info.html\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"About BackupPC (opens in a new tab)\">About BackupPC<\/a> page.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing BackupPC on CentOS 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run System Update<\/h3>\n\n\n\n<p>Update your system packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf update<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Install BackupPC on CentOS 8<\/h3>\n\n\n\n<p>BackupPC 4 is available on EPEL repos. Therefore, install the EPEL repos on CentOS 8 by running the command;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install epel-release<\/code><\/pre>\n\n\n\n<p>EPEL repos provided BackupPC 4.3.2, which is the current stable release as of this writing.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf info backuppc<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Available Packages\nName         : BackupPC\nVersion      : 4.3.2\nRelease      : 1.el8\nArchitecture : x86_64\nSize         : 479 k\nSource       : BackupPC-4.3.2-1.el8.src.rpm\nRepository   : epel\nSummary      : High-performance backup system\nURL          : http:\/\/backuppc.github.io\/backuppc\/index.html\nLicense      : GPLv2+\nDescription  : BackupPC is a high-performance, enterprise-grade system for backing up Linux\n             : and WinXX and Mac OS X PCs and laptops to a server's disk. BackupPC is highly\n             : configurable and easy to install and maintain.\n             : \n             : NOTE: Proper configuration is required after install, see README.setup for more\n             : information.<\/code><\/pre>\n\n\n\n<p>Also, enable PowerTool Repos;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf config-manager \u2013set-enabled PowerTools<\/code><\/pre>\n\n\n\n<p>You can simply install BackupPC and all its required dependencies by executing the command below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>dnf install -y backuppc<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure BackupPC Server on CentOS 8<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Define BackupPC Backup Protocol<\/h3>\n\n\n\n<p>BackupPC supports different protocols to get backup data from devices being backed up:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>smb<\/strong>&nbsp;\u2013 used for backing up windows machines<\/li>\n\n\n\n<li><strong>tar<\/strong>&nbsp;\u2013 used for backing up Linux\/Unix\/Mac OSX systems<\/li>\n\n\n\n<li><strong>rsync<\/strong>&nbsp;\u2013 used for backing up Linux\/Unix\/Mac OSX systems. This can also be used to backup Windows systems.<\/li>\n<\/ul>\n\n\n\n<p>It also supports the use of <code>ftp<\/code> protocol. The use FTP is however not a recommended method of backup.<\/p>\n\n\n\n<p>To define your preferred BackupPC backup protocol, open the BackupPC configuration file, <code><strong>\/etc\/BackupPC\/config.pl<\/strong><\/code> and navigate to the section of the specific backup protocol you want to use.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/BackupPC\/config.pl<\/code><\/pre>\n\n\n\n<p>For instance, the Rsync{d} protocol configuration section begins at;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n###########################################################################\n# Rsync\/Rsyncd Configuration\n# (can be overwritten in the per-PC log file)\n###########################################################################\n...<\/code><\/pre>\n\n\n\n<p>and ends at where FTP configuration starts;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n...\n###########################################################################\n# FTP Configuration\n# (can be overwritten in the per-PC log file)\n##########################################################################\n...<\/code><\/pre>\n\n\n\n<p>To use <code><strong>rsync<\/strong><\/code> protocol for backup, ensure that rsync is installed on a client being backed up and that the correct path is defined for the parameter, <code>$Conf{RsyncClientPath<\/code>.<\/p>\n\n\n\n<p>You can find the absolute path for rsync using <code>which<\/code> command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>which rsync\n<strong>\/usr\/bin\/rsync<\/strong><\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$Conf{RsyncClientPath} = \"<strong>\/usr\/bin\/rsync<\/strong>\";<\/code><\/pre>\n\n\n\n<p>Also ensure that the backup transfer method, <code>$Conf{XferMethod<\/code>,  for the client is set to <code>rsync<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Define BackupPC Client Backup User<\/h3>\n\n\n\n<p>By default, BackupPC uses the root user on the backup clients for backup purposes.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$Conf{RsyncSshArgs} = [\n        '-e', '$sshPath -l <strong>root<\/strong>',\n];<\/code><\/pre>\n\n\n\n<p>It is more secure to allow backup via a low-privileged user. In this demo, we will create a non-privileged user, <code><strong>backuppc<\/strong><\/code>, on every client to backup <code>which is only allowed to run rsync command with sudo rights<\/code> for backup purposes. Therefore, change this user accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$Conf{RsyncSshArgs} = [\n        '-e', '$sshPath -l <strong>backuppc<\/strong>',\n];<\/code><\/pre>\n\n\n\n<p>We will leave other Rsync settings with the default options. Note that all these are overwritable via the per-PC configuration.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configure BackupPC Administrative User<\/h3>\n\n\n\n<p>Default Administrative user for BackupPC is defined under CGI user interface configuration settings section. Normal users can only access information specific to their host. They can also start\/stop\/browse\/restore backups. Administrative users have full access to all hosts, plus overall status and log information. In this demo, we set the <code><strong>kifarunixadmin<\/strong><\/code> user as BackupPC admin.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$Conf{CgiAdminUsers}     = 'kifarunixadmin';<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Change Backup Data Directory<\/h3>\n\n\n\n<p>By default, BackupPC writes backup data into \/var\/lib\/BackupPC directory.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>$Conf{TopDir}      = '\/var\/lib\/BackupPC\/';<\/code><\/pre>\n\n\n\n<p>Just in case you need to change the location where backup data is stored to an external hard drive for example, it is recommended that instead of changing TopDir path create a symbolic link to the new location, or mount the new BackupPC store at the existing $Conf{TopDir} path.<\/p>\n\n\n\n<p>For example, assuming you have an empty drive, \/dev\/sdb1 as in our case, then you can simply mount it under, <code>\/var\/lib\/BackupPC\/<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mount \/dev\/sdb1 \/var\/lib\/BackupPC\/<\/code><\/pre>\n\n\n\n<p>To automount on boot, update the \/etc\/fstab with the entry with the line below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>\/dev\/sdb1 \/var\/lib\/BackupPC xfs defaults 1 2<\/code><\/pre>\n\n\n\n<p>Update the file-system accordingly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Configure BackupPC Apache Authentication<\/h3>\n\n\n\n<p>BackupPC uses Apache as the Web server by default and it is installed along with BackupPC itself. It also implements restricted access to the BackupPC web interface via Apache basic authentication.<\/p>\n\n\n\n<p>Therefore, you can open BackupPC Apache configuration, <code><strong>\/etc\/httpd\/conf.d\/BackupPC.conf<\/strong><\/code>, which is created by default and make your preferred changes. For example, these are a few changes we made, <code><strong>AuthUserFile<\/strong><\/code> and <code><strong>AuthName<\/strong><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/httpd\/conf.d\/BackupPC.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>...\nAuthType Basic\nAuthUserFile \/etc\/BackupPC\/.backuppc\nAuthName \"Kifarunix BackupPC Restricted Access\"\n\n&lt;IfModule mod_authz_core.c&gt;\n...<\/code><\/pre>\n\n\n\n<p>To allow external access to BackupPC, change the line, <code><strong>Require local<\/strong><\/code> to <code><strong>Require all granted<\/strong><\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n&lt;IfModule mod_authz_core.c&gt;\n  # Apache 2.4\n  &lt;RequireAll&gt;\n    Require valid-user\n    &lt;RequireAny&gt;\n      #Require local\n      Require all granted\n    &lt;\/RequireAny&gt;\n  &lt;\/RequireAll&gt;\n&lt;\/IfModule&gt;\n...<\/code><\/pre>\n\n\n\n<p>Save and quit the configuration file.<\/p>\n\n\n\n<p>Create the BackupPC authentication user and password and store them in the file specified by the value of the <code><strong>AuthUserFile<\/strong><\/code> parameter above. For example, to create web authentication user called <code>kifarunixadmin<\/code>; <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>htpasswd -c \/etc\/BackupPC\/.backuppc kifarunixadmin<\/code><\/pre>\n\n\n\n<p>You can add another user, say <code>kifarunixuser<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>htpasswd \/etc\/BackupPC\/.backuppc kifarunixuser<\/code><\/pre>\n\n\n\n<p>Adjust the permissions of the auth user file;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>chmod 666 \/etc\/BackupPC\/.backuppc<\/code><\/pre>\n\n\n\n<p>Change the user under which Apache runs as from <code>apache<\/code> to <code>backuppc<\/code> and leave the group as <code>apache<\/code>;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>vim \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>...\n<strong>User backuppc<\/strong>\nGroup apache\n...<\/code><\/pre>\n\n\n\n<p>Disable Apache Welcome Page;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mv \/etc\/httpd\/conf.d\/welcome.conf \/etc\/httpd\/conf.d\/welcome.conf.old<\/code><\/pre>\n\n\n\n<p>Disable directory listing;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sed -i 's\/Options Indexes FollowSymLinks\/Options -Indexes +FollowSymLinks\/' \/etc\/httpd\/conf\/httpd.conf<\/code><\/pre>\n\n\n\n<p>Check Apache for any errors;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>httpd -t<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Syntax OK<\/code><\/pre>\n\n\n\n<p>Start and enable Apache to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now httpd<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Running BackupPC<\/h3>\n\n\n\n<p>Once done with the configurations, start and enable BackupPC to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl enable --now backuppc<\/code><\/pre>\n\n\n\n<p>To check the status;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status backuppc<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf backuppc.service - BackupPC server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/backuppc.service; enabled; vendor preset: disabled)\n   Active: active (running) since Sat 2020-03-28 18:21:28 EAT; 21s ago\n Main PID: 10186 (BackupPC)\n    Tasks: 1 (limit: 11499)\n   Memory: 8.8M\n   CGroup: \/system.slice\/backuppc.service\n           \u2514\u250010186 \/usr\/bin\/perl \/usr\/share\/BackupPC\/bin\/BackupPC\n\nMar 28 18:21:28 vpnr.kifarunix-demo.com systemd&#91;1]: Started BackupPC server.<\/code><\/pre>\n\n\n\n<p>You can also verify if BackupPC is running using the <code>BackupPC_serverMesg<\/code>. All BackupPC programs should be run as BackupPC user, which is <code>backuppc<\/code> by default as defined by the <code><strong>$Conf{BackupPCUser}<\/strong><\/code> parameter.<\/p>\n\n\n\n<p>The backuppc user shell is set to <code>\/sbin\/nologin<\/code> by default, to run the BackupPC programs as backuppc user, see how the commands below are ran.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u backuppc \/usr\/share\/BackupPC\/bin\/BackupPC_serverMesg status info<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u backuppc \/usr\/share\/BackupPC\/bin\/BackupPC_serverMesg status hosts<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u backuppc \/usr\/share\/BackupPC\/bin\/BackupPC_serverMesg status jobs<\/code><\/pre>\n\n\n\n<p>According to BackupPC documentation, if the output of these commands doesn&#8217;t &#8220;<em><strong><code>look cryptic and confusing, and the output doesn't look like an error message, then all is ok<\/code><\/strong><\/em>&#8220;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Accessing BackupPC Web User Interface<\/h2>\n\n\n\n<p>To access BackupPC from the browser, you need to first allow Apache external access on firewall, if firewall is enabled;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --add-service={http,https} --permanent<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p>You can now access BackupPC via the URL <strong><code>http:\/\/server_IP_OR_hostname\/backuppc<\/code><\/strong>.<\/p>\n\n\n\n<p>Authenticate and proceed to BackupPC web dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"341\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-basic-auth.png\" alt=\"\" class=\"wp-image-5315\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-basic-auth.png?v=1585418996 894w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-basic-auth-768x293.png?v=1585418996 768w\" sizes=\"(max-width: 894px) 100vw, 894px\" \/><\/figure>\n\n\n\n<p>BackupPC web dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"475\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-dashboard.png\" alt=\"Install and Configure BackupPC on CentOS \" class=\"wp-image-5316\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-dashboard.png?v=1585419164 1365w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-dashboard-768x267.png?v=1585419164 768w\" sizes=\"(max-width: 1365px) 100vw, 1365px\" \/><\/figure>\n\n\n\n<p>If you authenticate to BackupPC web interface as non admin user, for instance, <code>kifarunixuser<\/code> in this demo, you can see such an interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1361\" height=\"300\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-non-admin-interface.png\" alt=\"\" class=\"wp-image-5321\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-non-admin-interface.png?v=1585471227 1361w, https:\/\/kifarunix.com\/wp-content\/uploads\/2020\/03\/backuppc-non-admin-interface-768x169.png?v=1585471227 768w\" sizes=\"(max-width: 1361px) 100vw, 1361px\" \/><\/figure>\n\n\n\n<p>You have successfully installed BackupPC 4.3.2. That brings us to the end of our guide on how to install and configure BackupPC.<\/p>\n\n\n\n<p>In our next guides, we will learn how to backup Linux systems with BackupPC server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Reference<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"BackupPC Documentation: Installing BackupPC (opens in a new tab)\" href=\"https:\/\/backuppc.github.io\/backuppc\/BackupPC.html#Installing-BackupPC\" target=\"_blank\">BackupPC Documentation: Installing BackupPC<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Other Related Tutorials<\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/backup-windows-system-via-smb-using-backuppc\/\" target=\"_blank\">Backup Windows System via SMB Using BackupPC<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/backup-windows-system-with-backuppc-using-rsyncd\/\" target=\"_blank\">Backup Windows System with BackupPC Using Rsyncd<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/kifarunix.com\/install-and-configure-backuppc-on-debian-10\/\" target=\"_blank\">Install and Configure BackupPC on Debian 10<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/how-to-install-and-configure-backuppc-as-a-backup-server-on-ubuntu-18-04\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">How to Install and Configure BackupPC as a Backup Server on Ubuntu 18.04<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, we are going learn how to install and configure BackupPC on CentOS 8.&nbsp;BackupPC&nbsp;is a high-performance enterprise-grade backup software suite with a web-based<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,907,39],"tags":[89,1385,1386,1388,1389,1142,1387],"class_list":["post-5311","post","type-post","status-publish","format-standard","hentry","category-howtos","category-backuppc","category-storage","tag-backuppc","tag-backuppc-4-3-2","tag-backuppc-centos-8","tag-backuppc-rsync","tag-backuppc-rsynd","tag-centos-8","tag-install-backuppc-centos-8","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5311"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=5311"}],"version-history":[{"count":10,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5311\/revisions"}],"predecessor-version":[{"id":21335,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/5311\/revisions\/21335"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=5311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=5311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=5311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}