1080*80 ad

How to Install and Configure BackupPC on CentOS 8

Setting up a robust backup solution is critical for any server environment. This guide walks you through the process of installing and configuring a popular open-source backup system designed for Linux and Windows hosts.

Before beginning, ensure your system is updated. Open a terminal and run:

sudo dnf update -y

This ensures you have the latest packages and dependencies.

Prerequisites and Repository Setup

BackupPC and its dependencies are often available in the EPEL (Extra Packages for Enterprise Linux) repository. If EPEL is not already installed, add it with:

sudo dnf install epel-release -y

Now, install the backup software and required packages. This typically includes the main package, Perl modules, utilities like rsync and ssh, and a web server like Apache (httpd) for the administrative interface. Execute the installation command:

sudo dnf install BackupPC perl-CGI perl-CGI-Session perl-File-RsyncP perl-HTML-Table perl-Number-Bytes-Human perl-Net-FTP perl-Archive-Tar perl-IO-Zlib perl-DBD-mysql perl-Term-ReadKey rsync ssh httpd mod_fcgid -y

This command installs BackupPC, its necessary Perl modules, utilities, and the Apache web server along with the FastCGI module.

Web Server Configuration

The administrative interface runs via a web server. You need to configure Apache to serve the BackupPC CGI scripts. Configuration files for BackupPC web access are usually placed in the Apache configuration directory.

First, enable and start the Apache service:

sudo systemctl enable httpd
sudo systemctl start httpd

BackupPC provides an example Apache configuration file. You typically need to include or symlink this configuration into Apache’s configuration. The file is often found at /usr/share/BackupPC/BackupPC.apache.conf. Create a link or copy it to the Apache configuration directory, for example, /etc/httpd/conf.d/:

sudo ln -s /usr/share/BackupPC/BackupPC.apache.conf /etc/httpd/conf.d/

Next, you need to set up authentication for the web interface. Edit the Apache configuration file you just linked or copied. Find the section related to authentication and configure it. A common method is basic authentication using an htpasswd file.

Create the htpasswd file and add a user (replace ‘backuppcadmin’ with your desired username):

sudo htpasswd -c /etc/BackupPC/htpasswd backuppcadmin

You will be prompted to set a password for the user.

Now, restart Apache to load the new configuration:

sudo systemctl restart httpd

BackupPC Service Configuration

The BackupPC service itself needs to be enabled and started.

sudo systemctl enable backuppc
sudo systemctl start backuppc

Check the status to ensure it’s running:

sudo systemctl status backuppc

Firewall Configuration

If your system has a firewall enabled (like firewalld), you need to allow HTTP traffic to access the web interface.

sudo firewall-cmd –permanent –zone=public –add-service=http
sudo firewall-cmd –reload

Accessing the Web Interface

Open a web browser and navigate to your server’s IP address or hostname followed by /BackupPC. For example, http://your_server_ip/BackupPC. You will be prompted for the username and password you set with htpasswd.

Initial Configuration

Once logged in, explore the interface. The primary configuration is done via the Edit Config section. Key configuration files are config.pl (main settings) and hosts (defining clients to backup).

Edit config.pl through the web interface or by editing the file directly at /etc/BackupPC/config.pl. Configure essential parameters like $Conf{TopDir} (where backups are stored, default is often /var/lib/BackupPC), $Conf{WakeupSchedule}, and email settings.

Edit the hosts file (/etc/BackupPC/hosts) to list the clients you want to back up. Each line typically contains the hostname or IP address and the backup method (e.g., ssh, rsync).

Example hosts entry for a client named ‘client1’ using rsync over ssh:

client1 $Conf{RsyncClientPath}

For detailed client configuration (like directories to include/exclude, backup schedules), you’ll edit the configuration specifically for that host within the web interface (Edit Hosts) or in the corresponding host configuration file (e.g., /etc/BackupPC/pc/client1.pl).

Remember to save changes and potentially restart the BackupPC service if editing files directly.

With these steps completed, your BackupPC server is installed and basic configuration is set up, ready for you to define your backup jobs and schedules.

Source: https://kifarunix.com/install-and-configure-backuppc-on-centos-8/

900*80 ad

      1080*80 ad