+44 151 528 8706 [email protected]

Turn your old pc into a backup machine

There is a saying that goes “You can never have enough backups”
We know most hosts offer daily backups for free, however you always should backup your website locally to be sure.

Today we are going to talk and teach you on how you could turn your old unused pc into an automatic backup for your website.

What are you going to need.

 

  1. A 16GB bootable device.
  2. A working PC you don’t need anymore.
    The system specs recommended for this should be:

    Intel core2quad
    4+GB RAM
    80+GB HardDrive

We are going to install UBUNTU!

 Installing Ubuntu might sound very hard to you, but its fairly simple.

To get the ISO file, go to the following website: UBUNTU

You will need to turn that ISO file to a bootable installation device, for that we recommend RUFUS

After downloading both the above files, open rufus select the ubuntu iso file and hit start. (it can take up to 10 minutes for the process to complete.)

After that, connect the usb device to the PC you’re looking to turn into a backup machine, turn your pc on and boot it from the USB.

To get into the boot menu you have to hold one of the buttons mentioned below: (It depends on the PC manufacturer)

ESC, DEL, F9, F11, F12, F8.

From there its pretty simple, however, if you’re not sure, you can check out this VIDEO.

Install BackupPC

You should always update your machine, to do so, open terminal and execute the below command:

sudo apt-get update

To install backuppc, execute the below command:

sudo apt-get install backuppc

After that you will prompted to setup the email service, which for our use case we won’t need it, see above images.

Setup WebServer

After selecting the mail server settings, you will prompted  with selecting  the web server you would like to use, for that select apache2.

    Change the Require local to Require ip 10.0.1

    Configure BackupPC’s Web Interface

    1. Edit the config file of BackupPC using the command below:

    sudo nano /etc/apache2/conf-enabled/backuppc.conf

    Change the Require local to Require ip and put your machines local IP, which usually starts with 192.168..

    To save press Ctrl+x, y, Enter

    To find  your local IP, execute the following command:

    ifconfig

    2. Edit the config file of Apache2 Ports

    sudo nano /etc/apache2/ports.conf

    Change the
    Listen 80 to Listen 8000

    To save press Ctrl+x, y, Enter

    Install htpasswd of Apache2

    sudo apt-get install apache2-utils

    Change the password of BackupPC Web Interface

    sudo htpasswd /etc/backuppc/htpasswd backuppc

    3. Restart Services

    sudo service backuppc restart
    sudo service apache2 restart

    Done, backuppc is installed, to access it type the following in your browser (change the yourlocalip part with the machine’s local IP)

    http://your-local-ip:8000/backuppc

     

     

     

      Configuration:

      1. Generate a SSH keys for user backuppc

      Open terminal on the backup machine, execute the following command:

      sudo su – backuppc

      ssh-keygen

      /usr/bin/cat ~/.ssh/id_rsa.pub

      Copy the key generated.

      exit

      Login to the remote host as root on terminal.

      Execute the command:

      sudo nano ~/.ssh/authorized_keys

      Paste the generated key earlier there.

      Ctrl+x, y, Enter

      2. Edit the hosts config file of BackupPC

      sudo nano /etc/backuppc/hosts

      ----------------Copy,append the below----------------
      
      Yourdomain.com      0       backuppc

       Change yourdomain.com with your actual domain

      Ctrl+x, y, Enter

      3.Create a config file of the new host of BackupPC

      sudo nano /etc/backuppc/yourdomain.com.pl

      Change yourdomain.com part with your actual domain:

      Paste the below:

       

      $Conf{ClientNameAlias} = 'Your-IP';
      
      $Conf{XferMethod} = 'rsync';
      
      $Conf{RsyncShareName} = [
        '/'
      ];
      
      $Conf{RsyncArgsExtra} = [
        '--one-file-system'
      ];
      
      $Conf{PingMaxMsec} = 300;
      Ctrl+x, y, Enter

      Change the your-ip par with your remote server IP.

      Execute the below commands one by one.

      sudo chown backuppc:www-data /etc/backuppc/yourdomain.com.pl
      
      sudo chmod 644 /etc/backuppc/yourdomain.com.pl

      4. Restart BackupPC by executing the following command.

      sudo service backuppc restart

      5. Start the first full backup

      sudo su – backuppc

      ssh [email protected]

      exit

      /usr/share/backuppc/bin/BackupPC_serverMesg backup Yourip yourdomain.com backuppc 1

      exit

      If your server has a non standard SSH port, you need to edit the config, to do so: see screenshots below:

       

      How to Mount an NFS Share in Linux

      Network File System (NFS) is a distributed file system protocol that allows you to share remote directories over a network. With NFS, you can mount...

      How to install Plesk on CentOS

      Plesk is a commercial web hosting and server data center automation software with a control panel developed for Linux and Windows-based retail hosting...

      Plesk vs cPanel

      When choosing between web hosting control panels, it’s often a toss-up between Plesk or cPanel. Between them, they dominate the market for users looking for account and server...

      We're Here To Help!

      13 + 9 =

      Head Office

      Ukshin Kovaçica, 10,000 Pristina, Republic of Kosovo

      Call Us

      +44 151 528 8706