Here are the different apps in linux for compressing and archiving files.

Definitions:

Tarball: A tarball is a collection of multiple files in Linux stored as a single file. The term tarball comes from the coal-based sealant used during construction works. A tarball is often simply called a TAR file, which stands for Tape Archive. This is because the TAR filetype was originally created to store data in magnetic tapes.

Gzip: GNU gzip is a file compression algorithm used to compress files. The file extension for gzip is GZ and therefore, you can deduce that any file ending with GZ has been compressed using the gzip algorithm.

TAR.GZ: A TAR.GZ file is a version of a tarball compressed with the gzip algorithm. TAR is the file extension for tarballs, whereas GZ denotes gzip. The TGZ file extension is also used sometimes instead of TAR.GZ.

Bzip2: Similar to gzip, several other file compression algorithms are also available, including bzip2. When you compress a TAR file using bzip2, the output file will have either of the following extensions: TAR.BZ2, TAR.BZ, or simply TBZ.

How to Create TAR and TAR.GZ Files

Using the tar Utility
The basic syntax to create compressed tarballs using the tar command is:

$ sudo tar -cvzf archive filename
$ sudo tar -cvzf archive directory

Note that you need to pass the file extension (TAR or TAR.GZ) in the archive name as follows:

$ sudo tar -cvzf new.tar.gz big-file.txt
$ sudo tar -cvf new.tar big-file.txt

To archive and compress the /Documents directory using tar:

$ sudo tar -cvzf new.tar.gz ~/Documents

You can also compress multiple directories and files by creating a single tarball. To do so:

$ sudo tar -cvzf new.tar.gz ~/Documents ~/Downloads file1.txt file2.txt

Want to have your own Slack like online chat hostedon your own server? Here is the process. First spin up a VM with Debian 11. Enable snaps on Debian and install Rocket.Chat Server
Snaps are applications packaged with all their dependencies to run on all popular Linux distributions from a single build. They update automatically and roll back gracefully.

Read More

Check Debian Version on Debian website:
https://www.debian.org/releases/
Check version on system:

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Or

$ sudo cat /etc/os-release

USERS SHOULD BACKUP ALL DATA before attempting a release upgrade – SEE https://wiki.debian.org/DebianStability

Only after the back – do the following:

Ensure your system is up-to-date in it’s current release.

$ sudo apt update
$ sudo apt upgrade

If you haven’t already, ensure all backups are up-to-date.

Make a backup of the /etc/apt/sources.list file:

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

In a text editor, replace the codename of your release with that of the next release in APT’s package sources
For instance, the line:

deb https://deb.debian.org/debian/ buster main

should be replaced with

deb https://deb.debian.org/debian/ bullseye main
$ sudo nano /etc/apt/sources.list 

# Clean and update package lists

$ sudo apt clean
$ sudo apt update

Perform the major release upgrade, removing packages if required

$ sudo apt full-upgrade

Remove packages that are not required anymore. Be sure to review this list: you may want to keep some of them

$ sudo apt autoremove

Reboot to make changes effective (optional, but recommended)

$ sudo shutdown -r now

Locate mariadb config files:

# cd /etc/mysql/mariadb.conf.d
# ls -la
total 28
drwxr-xr-x 2 root root 4096 Sep 23 22:52 .
drwxr-xr-x 4 root root 4096 Sep 30 18:20 ..
-rw-r--r-- 1 root root  575 Feb 17  2022 50-client.cnf
-rw-r--r-- 1 root root  231 Feb 17  2022 50-mysql-clients.cnf
-rw-r--r-- 1 root root  927 Feb 17  2022 50-mysqld_safe.cnf
-rw-r--r-- 1 root root 3666 Feb 19  2022 50-server.cnf
-rw-r--r-- 1 root root  570 Feb 17  2022 60-galera.cnf

Tweaking mariadb
To optimize the server, edit 50-server.cnf

root@webserver:/etc/mysql/mariadb.conf.d# nano 50-server.cnf

my.cnf Files
MariaDB is normally configured by editing the my.cnf file.

The following my.cnf example files were included with MariaDB until MariaDB 10.3.0. If present, you can examine them to see more complete examples of some of the many ways to configure MariaDB and use the one that fits you best as a base. Note that these files are now quite outdated, so what was huge a few years ago may no longer be seen as such.

my-small.cnf
my-medium.cnf
my-large.cnf
my-huge.cnf

Run the tuner

wget http://mysqltuner.pl/ -O mysqltuner.pl
Then execute it:
perl mysqltuner.pl

Create a simple bash script to check if MySQL is running and if not to restart it.

#!/bin/bash

# Check if MySQL is running
sudo service mysql status > /dev/null 2>&1

# Restart the MySQL service if it's not running.
if [ $? != 0 ]; then
    sudo service mysql restart
fi

Run this script every 5 minutes using a cron job like this one:

 */5 * * * * /home/user/scripts/monitor.sh > /dev/null 2>&1

Dnsmasq is a lightweight, easy to configure, DNS forwarder and DHCP server. It is designed to provide DNS and optionally, DHCP, to a small network. It can serve the names of local machines which are not in the global DNS.

Source: https://wiki.debian.org/dnsmasq

Basic DNS Setup
First things first, let’s install the package:

apt-get update
apt-get install dnsmasq

If your goal was to set up a simple DNS server, you just succeeded. To test it, use your favorite DNS lookup tool pointed at localhost:

dig debian.org @localhost
; <<>> DiG 9.16.33-Debian <<>> debian.org @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23056
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;debian.org.                    IN      A

;; ANSWER SECTION:
debian.org.             300     IN      A       149.20.4.15
debian.org.             300     IN      A       130.89.148.77
debian.org.             300     IN      A       128.31.0.62

;; Query time: 44 msec
;; SERVER: ::1#53(::1)
;; WHEN: Thu Sep 29 16:26:24 CDT 2022
;; MSG SIZE  rcvd: 87

or

nslookup debian.org localhost
Server:         localhost
Address:        ::1#53

Non-authoritative answer:
Name:   debian.org
Address: 128.31.0.62
Name:   debian.org
Address: 130.89.148.77
Name:   debian.org
Address: 149.20.4.15
Name:   debian.org
Address: 2001:67c:2564:a119::77
Name:   debian.org
Address: 2603:400a:ffff:bb8::801f:3e
Name:   debian.org
Address: 2001:4f8:1:c::15

By default, DNS is configured to forward all requests to your system’s default DNS settings. In case you didn’t know, these are stored in the /etc/resolv.conf

To add names, simply add them to your /etc/hosts file.

nano /etc/hosts
192.168.0.155   ipgw.io 
dig ipgw.io @localhost

; <<>> DiG 9.16.33-Debian <<>> ipgw.io @localhost
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53022
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;ipgw.io.                       IN      A

;; ANSWER SECTION:
ipgw.io.                0       IN      A       192.168.0.155

;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Thu Sep 29 16:31:02 CDT 2022
;; MSG SIZE  rcvd: 52

Choosing Your Interfaces
One you will probably want to do is tell dnsmasq which ethernet interface it can and cannot listen on, as we really don’t want it listening on the internet. Around line 69 of the /etc/dnsmasq.conf file, you will see:

#interface=

By default, DHCP is turned off.

Now change your dns on the IPv4 to your dnsmasq address server and your DNS server like Cloudflare.

So, the following we run the commands to set up apache for wordpress.

Download and unzip the WordPress package from:

# wget https://wordpress.org/latest.tar.gz

Then extract the package to the apache root directory:

# tar -xzvf latest.tar.gz --directory /var/www/ipgw

Activate Mod Rewrite

# sudo a2enmod rewrite

Create vhosts

<VirtualHost *:80>
    ServerName ipgw.io
    ServerAlias www.ipgw.io
    ServerAdmin webmaster@ipgw.io
    DocumentRoot /var/www/ipgw

    <Directory /var/www/ipgw>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/ipgw.io-error.log
    CustomLog ${APACHE_LOG_DIR}/ipgw.io-access.log combined
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin rogerp@local
    ServerName www.ipgw.io
    ServerAlias ipgw.io
    DocumentRoot /var/www/ipgw
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ipgw.io.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/ipgw.io.key
</VirtualHost>

<VirtualHost *:443>
    ServerAdmin rogerp@local
    ServerName www.ipgw,io
    ServerAlias ipgw.io

    DocumentRoot /var/www/ipgw

    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/ipgw.io.crt
    SSLCertificateKeyFile /etc/pki/tls/certs/ipgw.io.key
</VirtualHost>

After installing it, you will need to restart Apache services with the command:

service apache2 restart

If needed, you will need to edit the config file and find the directive:

AllowOverride None

Change it to:

AllowOverride All
Order allow,deny
Allow from all