How to install MySQL 8 on Ubuntu 22.04

MySQL is an open-source relational database management system. Relational databases organize data into one or more data tables in which data types may be related to each other. Relations help structure data. MySQL has stand-alone clients that allow users to interact directly with a MySQL database using SQL.

MySQL is part of the LAMP stack component which stands for Linux, Apache/Nginx, MySQL/MariaDB, and PHP/Python/Perl. In this tutorial, I will show you how to install MySQL 8 on Ubuntu 22.04.

Installing MySQL 8 on Ubuntu 22.04

1. Update system repositories

Ensure that your repositories are up to date in order to avoid running into unwarranted errors during the installation.

sudo apt update && apt upgrade -y

2. Set MySQL repository

Ubuntu comes with default MySQL packages. So to install the latest version we are going to download the packages with the following command.

curl -LO https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb

Now that the download is complete, we need to install the .deb file in our system. Use the following command to install. To check the downloaded file, do an ls

sudo dpkg -i mysql-apt-config_0.8.20-1_all.deb

It will open a configuration window where you will be required to choose the version of MySQL to install.

Nextgentips-MySQL config window

Choose Ubuntu focal and press ok. Next you will see the something like the below screenshot.

Nextgentips-MySQL apt config

Choose MySQL Server and cluster and press enter to move to the next step. The next step choose MySQL 8.0

We can check if MySQL 8.0 is available with the following command

$ sudo apt-cache policy mysql-server
mysql-server:
  Installed: (none)
  Candidate: 8.0.28-0ubuntu4
  Version table:
     8.0.28-0ubuntu4 500
        500 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 Packages

3. Install MySQL 8.0 on Ubuntu 22.04

Let’s now proceed to install MySQL 8 on our system using the following command.

sudo apt install mysql-server -y

You will see the following sample output.

The following additional packages will be installed:
  libcgi-fast-perl libcgi-pm-perl libclone-perl libencode-locale-perl libevent-pthreads-2.1-7 libfcgi-bin libfcgi-perl libfcgi0ldbl
  libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl
  liblwp-mediatypes-perl libmecab2 libprotobuf-lite23 libtimedate-perl liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils
  mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0
Suggested packages:
  libdata-dump-perl libipc-sharedcache-perl libbusiness-isbn-perl libwww-perl mailx tinyca
The following NEW packages will be installed:
  libcgi-fast-perl libcgi-pm-perl libclone-perl libencode-locale-perl libevent-pthreads-2.1-7 libfcgi-bin libfcgi-perl libfcgi0ldbl
  libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl
  liblwp-mediatypes-perl libmecab2 libprotobuf-lite23 libtimedate-perl liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils
  mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0
0 upgraded, 28 newly installed, 0 to remove and 0 not upgraded.
Need to get 29.0 MB of archives.

You can check if MySQL have been installed again.

$ apt-cache policy mysql-server
mysql-server:
  Installed: 8.0.28-0ubuntu4
  Candidate: 8.0.28-0ubuntu4
  Version table:
 *** 8.0.28-0ubuntu4 500
        500 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

4. Secure MySQL installation

We need to secure installed MySQL by running the following command.

$ sudo mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y 

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

5. Configuring MySQL services

We can enable MySQL to start automatically whenever we reboot our server. We do so with the following command.

sudo systemctl enable mysql

To check the status of MySQL we use the following command.

$ sudo systemctl status mysql 
● mysql.service - MySQL Community Server
     Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2022-04-30 06:36:22 UTC; 18min ago
   Main PID: 2327 (mysqld)
     Status: "Server is operational"
      Tasks: 38 (limit: 1119)
     Memory: 353.1M
        CPU: 2.956s
     CGroup: /system.slice/mysql.service
             └─2327 /usr/sbin/mysqld

Apr 30 06:36:21 ubuntu systemd[1]: Starting MySQL Community Server...
Apr 30 06:36:22 ubuntu systemd[1]: Started MySQL Community Server.

To start MySQL use the following command.

sudo systemctl start mysql

To stop the MySQL service use:

sudo systemctl stop mysql

And to restart MySQL again use.

sudo systemctl restart mysql

To login to MySQL we type the following

mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.28-0ubuntu4 (Ubuntu)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

Conclusion

We have successfully installed MySQL 8.0 on Ubuntu 22.04.

How to install RabbitMQ on Ubuntu 22.04

RabbitMQ is an open-source message broker software. It’s a software where queues are defined and to which applications connect in order to transfer a message or messages. Think of it as a middle man who acts as a broker. They can be used to reduce loads and delivery times for web application servers by delegating tasks that take up a lot of resources and or time to a third party that has no other job

Reasons for Using RabbitMQ

Message queueing allows web servers to respond to requests quickly instead of being forced to perform resource-heavy procedures on the spot that may cause delays.

Message queueing is important when you want to distribute a message to multiple consumers and also to balanced loading between worker nods.

Installing RabbitMQ 3.9 on Ubuntu 22.04

RabbitMQ is included in Ubuntu repositories but it lacked behind in terms of version releases. It is not the updated version because it takes longer to be updated.

1. Update system repositories

We need to start off by updating our repositories to make them up to date.

sudo apt update && apt upgrade -y 

2. Install Erlang

Erlang/OTP platform is a complex system consisting of many smaller modules. RabbitMQ requires Erlang to operate.

Let’s start by adding Erlang to the repository manually. Use the following commands:

wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
sudo dpkg -i erlang-solutions_2.0_all.deb

Next, we need to add Erlang public key to the apt-secure repository.

wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc

Lastly is to install Erlang but first run the system update again for the changes to take effect.

sudo apt update
sudo apt install erlang -y

3. Install RabbitMQ on Ubuntu 22.04

Now that we have satisfied all the requirements, we can now install RabbitMQ found on Ubuntu repositories with the following command.

sudo apt install rabbitmq-server -y

You will get the following output.

The following NEW packages will be installed:
  rabbitmq-server socat
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.5 MB of archives.
After this operation, 24.3 MB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 socat amd64 1.7.4.1-3ubuntu4 [349 kB]
Get:2 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 rabbitmq-server all 3.9.13-1 [15.2 MB]
Fetched 15.5 MB in 0s (37.3 MB/s)     
Selecting previously unselected package socat.
(Reading database ... 114923 files and directories currently installed.)
Preparing to unpack .../socat_1.7.4.1-3ubuntu4_amd64.deb ...
Unpacking socat (1.7.4.1-3ubuntu4) ...
Selecting previously unselected package rabbitmq-server.
Preparing to unpack .../rabbitmq-server_3.9.13-1_all.deb ...
Unpacking rabbitmq-server (3.9.13-1) ...
Setting up socat (1.7.4.1-3ubuntu4) ...
Setting up rabbitmq-server (3.9.13-1) ...
Adding group `rabbitmq' (GID 122) ...
Done.
Adding system user `rabbitmq' (UID 114) ...
Adding new user `rabbitmq' (UID 114) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Created symlink /etc/systemd/system/multi-user.target.wants/rabbitmq-server.service → /lib/systemd/system/rabbitmq-server.service.
Processing triggers for man-db (2.10.2-1) ...

Use apt cache-policy rabbitmq-server to check your installed RabbitMQ.

apt cache-policy rabbitmq-server 

You will see the following output.

#output
rabbitmq-server:
  Installed: 3.9.13-1
  Candidate: 3.9.13-1
  Version table:
 *** 3.9.13-1 500
        500 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 Packages
        100 /var/lib/dpkg/status

4. Configuring RabbitMQ

After installation is complete, we now need to do some configuration on RabbitMQ.

First, start the RabbitMQ service with the following command.

sudo systemctl start rabbitmq-server

Check the status if RabbitMQ is running with the following command:

$ sudo systemctl status rabbitmq-server
● rabbitmq-server.service - RabbitMQ Messaging Server
     Loaded: loaded (/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-04-29 19:38:53 UTC; 2min 35s ago
   Main PID: 17434 (beam.smp)
      Tasks: 21 (limit: 1119)
     Memory: 108.8M
        CPU: 8.051s
     CGroup: /system.slice/rabbitmq-server.service
             ├─17434 /usr/lib/erlang/erts-12.2.1/bin/beam.smp -W w -MBas ageffcbf -MHas ageffcbf -MBlmbcs 512 -MHlmbcs 512 -MMmcs 30 -P 10485>
             ├─17445 erl_child_setup 65536
             ├─17492 inet_gethost 4
             └─17493 inet_gethost 4
lines 1-12/12 (END)

Enable RabbitMQ on boot so that you don’t need to start every time when you reboot your system.

sudo systemctl enable rabbitmq-server

5. Enable RabbitMQ dashboard. (Optional)

You can enable dashboard management for RabbitMQ with the following command.

sudo rabbitmq-plugins enable rabbitmq_management

You will get the following output.

Enabling plugins on node rabbit@ubuntu:
rabbitmq_management
The following plugins have been configured:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch
Applying plugin configuration to rabbit@ubuntu...
The following plugins have been enabled:
  rabbitmq_management
  rabbitmq_management_agent
  rabbitmq_web_dispatch

started 3 plugins.

You can now access the dashboard using http://:15672. but you will need to create admin user first.

15672 is the port RabbitMQ is served into.

You can create an admin login or you can use the quest if you only want to see what’s in it but if you want to do some operations, you will need to create the admin.

$ sudo rabbitmqctl add_user admin passwd
Adding user "admin" ...
Password: 
passwd
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.

$ sudo rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
Nextgentips. RabbitMQ dashboard

Conclusion

We have successfully installed RabbitMQ on Ubuntu 22.04. To know more on the management commands head over to RabbitMQ getting started. I hope you enjoyed and thank you for reading.

How to Install Envoy Proxy on Ubuntu 22.04

In this tutorial guide, I will show you how to install Envoy Proxy Server on Ubuntu 22.04

Envoy is an L7 proxy and communication bus designed for large modern service-oriented architecture. The project was born out of the belief that the network should be transparent to applications. When network and application problems occur, it should be easy to determine the source of the problem.

Envoy is an open-source edge and service proxy, designed for cloud-native applications. Let’s dive in and learn how to install Envoy on Ubuntu 22.04.

High Level Envoy Proxy features

  • Its known for its advanced load balancing technique. It implements load balancing in a single place and have them accessible to any application.
  • It has front/edge proxy support.
  • It has best in class observability
  • It has gRPC support.
  • Has support for HTTP L7 routing
  • It supports HTTP/2
  • L3/L4 filter architecture. Envoy acts as a L3/L4 proxy
  • It support use of API for configuration management

Prerequisites

  • At least 2GB of RAM
  • Good internet connection
  • Ubuntu 22.04 server

Installing Envoy proxy server on Ubuntu 22.04

Installing Envoy Proxy, we are going to use the Tetrate packages until official packages are available.

1. Update system repositories.

The first thing is to update system repositories in order to make them up to date. This will avoid running into errors in the process of installation.

$ sudo apt update && apt upgrade -y

When both updates and upgrades are complete, we can now install envoy dependencies.

2. Install Envoy proxy dependencies

Envoy requires some set of programs to run effectively such as curl for running downloads, lsb-release, etc. Let’s install the following;

sudo apt install apt-transport-https gnupg2 curl lsb-release

You will see the following output.

# output
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
curl is already the newest version (7.81.0-1).
curl set to manually installed.
lsb-release is already the newest version (11.1.0ubuntu4).
lsb-release set to manually installed.
apt-transport-https is already the newest version (2.4.5).
gnupg2 is already the newest version (2.2.27-3ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

3. Add GPG key to envoy repository

In order to sign the envoy program, we need to download the GPG key to self-sign it. Keys help to prove the authenticity of the program’s downloads.

curl -sL 'https://deb.dl.getenvoy.io/public/gpg.8115BA8E629CC074.key' | sudo gpg --dearmor -o /usr/share/keyrings/getenvoy-keyring.gpg

If you want, you can verify the key with the echo command, if you get an ok as the output then it’s signed therefore move ahead and install the program.

echo a077cb587a1b622e03aa4bf2f3689de14658a9497a9af2c427bba5f4cc3c4723 /usr/share/keyrings/getenvoy-keyring.gpg | sha256sum --check

# output
/usr/share/keyrings/getenvoy-keyring.gpg: OK

Now we need to add the key to sources.list.d repository. To do so use the following command.

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/getenvoy-keyring.gpg] https://deb.dl.getenvoy.io/public/deb/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/getenvoy.list

We need to update our repositories again by doing an update again.

$ sudo apt update 

Whenever you update, you must see what you have added. Have look at the output below

# sample output
Get:6 https://deb.dl.getenvoy.io/public/deb/ubuntu jammy InRelease [5079 B]
Get:7 https://deb.dl.getenvoy.io/public/deb/ubuntu jammy/main amd64 Packages [4323 B]
Fetched 279 kB in 1s (362 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.

4. Install Envoy Proxy on Ubuntu 22.04

Now that we have completed all the prerequisites, we can now install Envoy proxy with the following command.

$ sudo apt install getenvoy-envoy

See the output below

The following NEW packages will be installed:
  getenvoy-envoy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.5 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://deb.dl.getenvoy.io/public/deb/ubuntu jammy/main amd64 getenvoy-envoy amd64 1.18.2.p0.gd362e79-1p75.g76c310e [16.5 MB]
Fetched 16.5 MB in 1s (14.2 MB/s)   
Selecting previously unselected package getenvoy-envoy.
(Reading database ... 93697 files and directories currently installed.)
Preparing to unpack .../getenvoy-envoy_1.18.2.p0.gd362e79-1p75.g76c310e_amd64.deb ...
Unpacking getenvoy-envoy (1.18.2.p0.gd362e79-1p75.g76c310e) ...
Setting up getenvoy-envoy (1.18.2.p0.gd362e79-1p75.g76c310e) ...

We can check the Envoy version installed with the following command;

$ envoy --version
envoy  version: d362e791eb9e4efa8d87f6d878740e72dc8330ac/1.18.2/clean-getenvoy-76c310e-envoy/RELEASE/BoringSSL

5. Run Envoy

To check Envoy commands use the help command

$ envoy --help

Let’s run Envoy with a demo configuration file

Download a envoy-demo.yaml file

wget https://www.envoyproxy.io/docs/envoy/latest/_downloads/92dcb9714fb6bc288d042029b34c0de4/envoy-demo.yaml

Run with this command:

$ envoy -c envoy-demo.yaml

-c tells envoy the path to its initial configuration

To know if Envoy is proxying, use the following

$ curl -v localhost:10000

Conclusion

We have learned how to install Envoy proxy on Ubuntu 22.04. To learn more of these check out the Envoy documentation.

How to Upgrade Linux Kernel to 5.18 Release on Ubuntu 22.04

In this tutorial, we are going to learn how to upgrade Linux Kernel to 5.18 mainline release on Ubuntu 22.04.

Linux Kernel is a free and open-source, monolithic, modular, multitasking Unix-like operating system. It is the main component of a Linux operating system and is the core interface between the computer’s hardware and its processes. It makes communication possible between computer hardware and processes running on it and it manages resources effectively.

Linux 5.18 mainline was released recently by Linux Torvalds with better new features to try out. The mainline tree is maintained by Linus Torvalds and It is where all new features are added and releases always come from.

Notable features on Linux Kernel 5.18

  • Introduction of schedular updates around NUMA balancing that can further enhance the performance of AMD EPYC servers.
  • Support for Intel Hardware feedback interface whih is now merged with intel’s new HFI driver for Hybrid processor.
  • Intel software Defined Silicone has been merged to that controversial Intel CPU feature about allowing the activation of extra silicone features using the cryptographic-signed keys.
  • Introduction of Intel Indirect Branch Tracking IBT which is part of Intel control flow enforcement technology with tiger lake CPUs.

Table of Contents

  1. Run updates for your system
  2. Check the current version of Linux kernel you are running
  3. Download Linux kernel headers from Ubuntu Mainline
  4. Download Linux Kernel image
  5. Download modules required to build the kernel
  6. Install new kernel
  7. Reboot the system
  8. Conclusion

Upgrade Linux Kernel to 5.18 release

1. Run system update

The first thing to do is to run system updates on our Ubuntu 20.04 server. Use the following command on your terminal.

$ sudo apt update && apt upgrade -y

When upgrades and updates are complete, we can now begin to download headers, modules, and images.

Before we can proceed let’s check the Linux kernel we are having with the following command.

uname -r
5.15.0-25-generic

Ubuntu 22.04 comes with a default Linux 5.15

2. Download Linux kernel Headers.

Linux kernel headers is a package providing the Linux kernel headers. These are part of the Kernel even though shipped separately. The headers act as an interface between internal kernel components and also between userspace and the kernel.

To download this package header, head over to the Ubuntu PPA mainline repository and make downloads for your amd64 system. We are going to download the following header files.

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc1/amd64/linux-headers-5.18.0-051800rc1_5.18.0-051800rc1.202204032230_all.deb

Another header file to download is this one. Download the generic one here.

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc1/amd64/linux-headers-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb

The sample output will look like this:

#output
--2022-04-26 07:18:57--  https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc1/amd64/linux-headers-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb
Resolving kernel.ubuntu.com (kernel.ubuntu.com)... 91.189.94.216
Connecting to kernel.ubuntu.com (kernel.ubuntu.com)|91.189.94.216|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3063028 (2.9M) [application/x-debian-package]
Saving to: ‘linux-headers-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb’

linux-headers-5.18.0-051800rc1-gene 100%[=================================================================>]   2.92M  --.-KB/s    in 0.1s    

2022-04-26 07:18:57 (29.3 MB/s) - ‘linux-headers-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb’ saved [3063028/3063028]

Note the difference between those headers

3. Download Linux kernel Modules

Linux kernels are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. A module can be configured as built-in or loadable. To dynamically load or remove a module, it has to be configured as a loadable module in the kernel configuration.

To download the Linux Kernel module run the following command on your terminal.

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc1/amd64/linux-modules-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb

Next is to download the image.

3. Download Linux Kernel Image

Linux kernel image is a snapshot of the Linux kernel that is able to run by itself after giving the control to it. For example, whenever you need to boot the system up, it will bootload an image from the hard disk.

To download the Linux Kernel image 5.17 run the following command on your terminal.

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc1/amd64/linux-image-unsigned-5.18.0-051800rc1-generic_5.18.0-051800rc1.202204032230_amd64.deb

Make sure you are seeing the image from the downloads if you do an ls.

Now that we have finished downloading images, modules, and headers it is now time to install them.

4. Install Linux Kernel on Ubuntu 22.04

To install Linux Kernel 5.18, let’s run the following command;

$ sudo dpkg -i *.deb

Wait for the process to complete before restarting the system.

reboot -n

After you have restarted the system, check the Linux Kernel release installed.

$ uname -r

The output you will now get is like this;

5.18.0-051800rc1-generic

Conclusion

As you can see we have successfully upgraded from 5.15.0-25-generic to 5.18.0-051800rc1-generic, the latter being the latest release.

check out this also: How to Upgrade Linux Kernel to 5.17 Release on Ubuntu 20.04

How to install Apache web server on Ubuntu 22.04

Apache HTTP Server is a free and open-source cross-platform web server software. The goal of the Apache project is to provide a secure, efficient, and extensible server that provides HTTP services in sync with the current standards.

The new Apache 2.4.x or newer is needed in order to operate a TLS 1.3 web server with OpenSSL 1.1.1

In this tutorial, we will explain how to install the Apache web server on Ubuntu 22.04.

1. Update system repositories

The first thing to do is to make sure your system repositories are up to date in order to avoid running into errors at a later stage during the installation.

sudo apt update && apt upgrade -y

2. Install the Apache package.

Now that we have updated and upgraded our system, we now need to install Apache2 in our system with the following command:

sudo apt install apache2 

Here apt will install apache2 with its dependencies.

#sample output
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,915 kB of archives.
After this operation, 7,686 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

After the installation is complete, lets check the status of our Apache2 server.

To check the status of Apache2 server use the following command:

sudo systemctl status apache2 
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor prese>
     Active: active (running) since Mon 2022-04-25 09:19:04 EAT; 5min ago
       Docs: https://httpd.apache.org/docs/2.4/
   Main PID: 20151 (apache2)
      Tasks: 55 (limit: 9355)
     Memory: 5.3M
        CPU: 49ms
     CGroup: /system.slice/apache2.service
             ├─20151 /usr/sbin/apache2 -k start
             ├─20152 /usr/sbin/apache2 -k start
             └─20153 /usr/sbin/apache2 -k start

Apr 25 09:19:04 zx-pc systemd[1]: Starting The Apache HTTP Server...
Apr 25 09:19:04 zx-pc apachectl[20147]: AH00558: apache2: Could not reliably de>
Apr 25 09:19:04 zx-pc systemd[1]: Started The Apache HTTP Server.
lines 1-16/16 (END)

From the above output, the Apache web server started out successfully, but the best way to test out is to request a page from Apache itself.

In order to know the IP address of your server host, you can do the following on your terminal.

hostname -I

Here you will get some addresses to try out.

Another way is to use icanhazip tool which gives us the address also to use in our browser.

curl -4 icanhazip.com
Apache2

3. Enable firewall

For good security practices, we need to enable a firewall in order to block unauthorized ports from accessing the system. Apache register itself with UFW upon installation. To list all available ufw profiles use the following command on your terminal.

sudo ufw app list
Available applications:
  Apache
  Apache Full
  Apache Secure
  CUPS

Here we only need to allow traffic on Apache only, that is port 80. To allow so do the following:

sudo ufw allow "Apache"

Lastly, check the status again

sudo ufw status 

4. Apache processes.

Whenever you are running apache, take into consideration the following processes, it will help you and save you time.

To start your web server

sudo systemctl start apache2 

To stop web server

sudo systemctl stop apache2

To restart Apache web server

sudo systemctl restart apache2

To reload Apache web server

sudo systemctl reload apache2

To disable Apache web server

sudo systemctl disable apache2

To re-enable Apache after disabling it.

sudo systemctl enable apache2

This will allow Apache2 to start automatically on boot.

Conclusion

We have installed Apache2 successfully on Ubuntu 22.04. In case of any problem consult the Apache documentation.

How to install Go 1.18 on Ubuntu 22.04

In this tutorial, we are going to explore how to install go on Ubuntu 22.04

Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast.

Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions.

Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection.

In this guide, we are going to learn how to install golang 1.18 on Ubuntu 22.04.

Go is not yet released. There is so much work in progress with all the documentation.

The changes that have been introduced are the following:

  • Go 1.18 includes an implementation of generic features. This include backward-compatibity changes to the language.
  • The syntax for function and type declarations now accepts type parameters.
  • Parameterized functions and types can be instatiated by following them with a list of type arguments in square brackets.
  • the syntax for interface types now permits the embedding of arbitrary types as well as union.
  • The new predeclared identifier any is an alias for the empty interface. It maybe used instaead of interface {}.
  • The go 1.18 compiler now correctly reports declared but not used errors for variables that are set inside a function literal but are never used.
  • The go 1.18 compiler now reports an overflow when passing a rune constant expression.
  • Go 1.18 introduces the new GOAMD64 environment variable which selects a version of AMD64 architecture.
  • Go get no longer builds or install packages in module-aware mod.
  • gofmt now reads and formats input files concurrently with a memory limit proportional GOMAXPROCS.
  • The vet tool is updated to support generic code.
  • The garbage collector now includes non-hip sources of garbage colector work when determining how frequently to run.

Related Articles

Installing Go 1.18 on Ubuntu 20.04

1. Run system updates

To begin with, we need to run system updates in order to make our current repositories up to date. To do so we need to run the following command on our terminal.

sudo apt update && apt upgrade -y

When both upgrades and updates are complete, go ahead to download go from its download page.

2. Installing Go

To install go we need to download it from go download page. we are going to download the beta release. We are going to use the curl command to download.

curl -LO https://go.dev/dl/go1.18beta1.linux-amd64.tar.gz

when the download is complete, extract the archive downloaded to your desired location. I will be using /usr/local directory.

sudo tar -C /usr/local -xzf go1.18beta1.linux-amd64.tar.gz

After extraction is complete move ahead and set up the go environment.

3. Setting Go Environment

To set up go environment we need to define the root of golang packages. We normally use GOROOT and GOPATH to define that environment. We need to set up the GOROOT location where the packages are installed.

export GOROOT=/usr/local/go

Next, we will need to set up the GOPATH. Let’s set up GOPATH in the $HOME/go directory.

export GOPATH=$HOME/go

Now we need to append the go binary PATH so that we can be able to access the program system-wide. Use the following command.

export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

To apply the changes we have made above, run the following command:

source ~/.bashrc

Lastly, we can do the verification with the following;

go version
go version go1.18beta1 linux/amd64

Let’s create a program to check all our settings. We will create a simple one.

Create a file main.go on the main directory.

touch main.go

On your favorite text editor do the following

sudo nano main.go

Insert the below code

$ package main

import "fmt"

func main(){
        fmt.Println("Hello Nextgentips")
}

To run the program use the following command;

go run main.go
Hello Nextgentips

Conclusion

Now you know how to install golang 1.18 in Ubuntu 20.04. You can consult the go documentation in case you have any problems.

How to install and configure QEMU 7 on Ubuntu 20.04

In this tutorial, we are going to learn how to install and configure QEMU 7 on Ubuntu 20.04.

QEMU is a free and open-source hypervisor, it emulates the machine’s processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems.

QEMU is capable of emulating a complete machine in software without the need for hardware virtualization support. It is also capable of providing userspace API virtualization for Linux and BSD kernel services. It is commonly invoked indirectly via libvirt library when using open source applications such as oVirt, OpenStack, and virt-manager.

Install QEMU on Ubuntu 20.04

1. Run system updates

To begin with, we need to update our repositories in order to make them up to date, Use the following command on your terminal.

$ sudo apt update && apt upgrade -y

When Updates are complete, now we can install QEMU.

2. Install QEMU 7 on Ubuntu 20.04

QEMU is available from Ubuntu repositories but in this tutorial, I will show you how to build from the source.

First, we are going to download the tar Qemu.

wget https://download.qemu.org/qemu-7.0.0.tar.xz

Second, We are going to extract the archive into our system.

tar xvJf qemu-7.0.0.tar.xz

The sample output will look like this below.

#output
qemu-7.0.0/target/i386/nvmm/nvmm-accel-ops.h
qemu-7.0.0/target/i386/nvmm/nvmm-all.c
qemu-7.0.0/target/i386/nvmm/nvmm-accel-ops.c
qemu-7.0.0/target/i386/machine.c
qemu-7.0.0/target/i386/helper.h
qemu-7.0.0/target/i386/cpu.c
qemu-7.0.0/target/i386/cpu-dump.c
qemu-7.0.0/target/i386/whpx/
qemu-7.0.0/target/i386/whpx/meson.build
qemu-7.0.0/target/i386/whpx/whpx-internal.h
qemu-7.0.0/target/i386/whpx/whpx-apic.c
qemu-7.0.0/target/i386/whpx/whpx-all.c
qemu-7.0.0/target/i386/whpx/whpx-accel-ops.h
qemu-7.0.0/target/i386/whpx/whpx-accel-ops.c
qemu-7.0.0/.dir-locals.el
qemu-7.0.0/block.c
qemu-7.0.0/.exrc
qemu-7.0.0/subprojects/
qemu-7.0.0/subprojects/libvhost-user/
qemu-7.0.0/subprojects/libvhost-user/libvhost-user.c
qemu-7.0.0/subprojects/libvhost-user/meson.build
qemu-7.0.0/subprojects/libvhost-user/libvhost-user-glib.c
qemu-7.0.0/subprojects/libvhost-user/link-test.c
qemu-7.0.0/subprojects/libvhost-user/standard-headers/
qemu-7.0.0/subprojects/libvhost-user/standard-headers/linux
qemu-7.0.0/subprojects/libvhost-user/libvhost-user.h
qemu-7.0.0/subprojects/libvhost-user/include/
qemu-7.0.0/subprojects/libvhost-user/include/atomic.h
qemu-7.0.0/subprojects/libvhost-user/libvhost-user-glib.h
qemu-7.0.0/qemu.nsi

Give it time to extract the contents into your system.

Third, cd into qemu 7.0.0 directory before we can do the configuration.

cd qemu-7.0.0

If you ls into the qemu directory, you will see the following content.

COPYING       blockdev-nbd.c  docs                  job-qmp.c          os-win32.c            qemu-nbd.c       storage-daemon
COPYING.LIB   blockdev.c      dtc                   job.c              page-vary-common.c    qemu-options.hx  stubs
Kconfig       blockjob.c      dump                  libdecnumber       page-vary.c           qemu.nsi         subprojects
Kconfig.host  bsd-user        ebpf                  linux-headers      pc-bios               qemu.sasl        target
LICENSE       capstone        fpu                   linux-user         plugins               qga              tcg
MAINTAINERS   chardev         fsdev                 memory_ldst.c.inc  po                    qobject          tests
Makefile      common-user     gdb-xml               meson              python                qom              tools
README.rst    configs         gdbstub.c             meson.build        qapi                  replay           trace
VERSION       configure       gitdm.config          meson_options.txt  qemu-bridge-helper.c  replication.c    trace-events
accel         contrib         hmp-commands-info.hx  migration          qemu-edid.c           roms             ui
audio         cpu.c           hmp-commands.hx       module-common.c    qemu-img-cmds.hx      scripts          util
authz         cpus-common.c   hw                    monitor            qemu-img.c            scsi             version.rc
backends      crypto          include               nbd                qemu-io-cmds.c        semihosting
block         disas           io                    net                qemu-io.c             slirp
block.c       disas.c         iothread.c            os-posix.c         qemu-keymap.c         softmmu

When you are inside the qemu directory, then it’s time you run the configuration file.

./configure

If you are getting any errors, please make sure you have to make installed in your system.

sudo apt install make -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  make-doc
The following NEW packages will be installed:
  make
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 162 kB of archives.
After this operation, 393 kB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu focal/main amd64 make amd64 4.2.1-1.2 [162 kB]
Fetched 162 kB in 0s (3628 kB/s)
Selecting previously unselected package make.
(Reading database ... 94907 files and directories currently installed.)
Preparing to unpack .../make_4.2.1-1.2_amd64.deb ...
Unpacking make (4.2.1-1.2) ...
Setting up make (4.2.1-1.2) ...
Processing triggers for man-db (2.9.1-1) ...

If you are still getting the error ninja not installed, please install ninja-build with the following command.

#sudo apt install ninja-build -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ninja-build
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 107 kB of archives.
After this operation, 338 kB of additional disk space will be used.
Get:1 http://mirrors.digitalocean.com/ubuntu focal/universe amd64 ninja-build amd64 1.10.0-1build1 [107 kB]
Fetched 107 kB in 0s (1872 kB/s)
Selecting previously unselected package ninja-build.
(Reading database ... 100528 files and directories currently installed.)
Preparing to unpack .../ninja-build_1.10.0-1build1_amd64.deb ...
Unpacking ninja-build (1.10.0-1build1) ...
Setting up ninja-build (1.10.0-1build1) ...
Processing triggers for man-db (2.9.1-1) ...

Also make sure libpixman-1-dev, glib2 are installed before running ./configure

Run ./configure again in your terminal and wait for it to finish. It will take time.

Sample output will look like this below.

Executing subproject libvhost-user 

libvhost-user| Project name: libvhost-user
libvhost-user| Project version: undefined
libvhost-user| C compiler for the host machine: cc -m64 -mcx16 (gcc 9.4.0 "cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0")
libvhost-user| C linker for the host machine: cc -m64 -mcx16 ld.bfd 2.34
libvhost-user| Dependency threads found: YES unknown (cached)
libvhost-user| Dependency glib-2.0 found: YES 2.64.6 (overridden)
libvhost-user| Build targets in project: 12
libvhost-user| Subproject libvhost-user finished.

Program cat found: YES (/usr/bin/cat)
Program scripts/decodetree.py found: YES (/usr/bin/python3 /root/qemu-7.0.0/scripts/decodetree.py)
Program ../scripts/modules/module_block.py found: YES (/usr/bin/python3 /root/qemu-7.0.0/block/../scripts/modules/module_block.py)
Program ../scripts/block-coroutine-wrapper.py found: YES (/usr/bin/python3 /root/qemu-7.0.0/block/../scripts/block-coroutine-wrapper.py)
Program scripts/modinfo-collect.py found: YES (/root/qemu-7.0.0/scripts/modinfo-collect.py)
Program scripts/modinfo-generate.py found: YES (/root/qemu-7.0.0/scripts/modinfo-generate.py)
Program nm found: YES
Program scripts/undefsym.py found: YES (/usr/bin/python3 /root/qemu-7.0.0/scripts/undefsym.py)
Program scripts/feature_to_c.sh found: YES (/bin/sh /root/qemu-7.0.0/scripts/feature_to_c.sh)
Configuring 50-edk2-i386-secure.json using configuration
Configuring 50-edk2-x86_64-secure.json using configuration
Configuring 60-edk2-aarch64.json using configuration
Configuring 60-edk2-arm.json using configuration
Configuring 60-edk2-i386.json using configuration
Configuring 60-edk2-x86_64.json using configuration
Program qemu-keymap found: NO
Program cp found: YES (/usr/bin/cp)
Program sphinx-build-3 sphinx-build found: NO
Program python3 found: YES (/usr/bin/python3)
Program diff found: YES (/usr/bin/diff)
Program dbus-daemon found: YES (/usr/bin/dbus-daemon)
Program /usr/bin/gdbus-codegen found: YES (/usr/bin/gdbus-codegen)
Program initrd-stress.sh found: YES (/root/qemu-7.0.0/tests/migration/initrd-stress.sh)
Build targets in project: 721

qemu 7.0.0

Lastly, we need to run make command in order to complete our installation.

make

Give a few minutes for the make command to complete execution.

To open QEMU using GUI, just type virt-manager on terminal

$ virt-manager

Check the version using the following command;

$ sudo apt show qemu-system-x86

The following output will be displayed.

To uninstall Qemu do the following

$ sudo apt purge "qemu*"
$ sudo apt autoremove

Conclusion

We have successfully installed QEMU 7 on our Ubuntu 20.04. To learn more you can consult QEMU documentation.

How to install Odoo 15 on Debian 11

In this tutorial, I will take you through the installation steps for Odoo 15 on Debian 11 server. So let’s dive right in.

Odoo is a popular CRM (Customer Relationship Management) software solution that is used by businesses of all sizes. Odoo is easy to use, has a wide range of features, and is backed by a team of experts. Odoo also has a robust plugin system that makes it easy to add new features and functionality to your CRM. Odoo is available in a number of languages.

Odoo allows users to manage their business data and processes in a centralized location, making it a valuable tool for small businesses and enterprise organizations. Odoo also offers a variety of features that make it an attractive choice for online marketing and sales operations.

Odoo is very user-friendly and it allows you to manage your business with ease. It has useful features such as a calendar for easy management of date functions, project management features for easy time tracking on any task, invoicing and tracking feature, and also has reports which make it easy to use and useful software for small and big businesses.

Prerequisites

  • You need to have Debian 11 server up and running
  • Have PostgreSQL installed
  • Have a non-root user with sudo privileges if you are not root

We have two versions of Odoo, the community version which is free and open-source, and the enterprise version available for enterprise customers only. We are going to install the free version i.e the community version.

Install Odoo 15 on Debian 11

1. Update system repositories

The first thing to do is to update your system repositories in order to make them up to date. Use the following command to do so.

sudo apt update && apt upgrade -y 

2. Install the PostgreSQL database

Odoo needs the PostgreSQL server to run smoothly. So we need to install it onto our system with the following command.

sudo apt install -y postgresql

Sample output from the installation of Postgresql

#output
Success. You can now start the database server using:

    pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5432 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
update-alternatives: using /usr/share/postgresql/12/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
Setting up sysstat (12.2.0-2ubuntu0.1) ...

Creating config file /etc/default/sysstat with new version
update-alternatives: using /usr/bin/sar.sysstat to provide /usr/bin/sar (sar) in auto mode
Created symlink /etc/systemd/system/multi-user.target.wants/sysstat.service → /lib/systemd/system/sysstat.service.
Setting up postgresql (12+214ubuntu0.1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.7) ...

Now that we have installed PostgreSQL, we need to start the server cluster with the following command.

pg_ctlcluster 12 main start

Then you can check the cluster if it is up and running with the following command.

sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2022-04-05 18:45:46 UTC; 3min 14s ago
   Main PID: 2321 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 1131)
     Memory: 0B
     CGroup: /system.slice/postgresql.service

Apr 05 18:45:46 ubuntu systemd[1]: Starting PostgreSQL RDBMS...
Apr 05 18:45:46 ubuntu systemd[1]: Finished PostgreSQL RDBMS.

You can read more on the installation of PostgreSQL 14 in this article. How to install PostgreSQL 14 on Ubuntu 20.04|21.10|22.04

3. Add Odoo package repository for Debian 11

Odoo provides a package repository for Ubuntu that will allow us to add nightly keys to our system repositories hence allowing us to install Odoo with ease.

So the first thing is to add keys to our system with the following command.

wget -O - https://nightly.odoo.com/odoo.key | apt-key add -

Then after that is complete, add Odoo nightly 15 to our sources.listd.d which will in turn allows us to make some required configuring to Odoo once installed.

echo "deb http://nightly.odoo.com/15.0/nightly/deb/ ./" >> /etc/apt/sources.list.d/odoo.list

Lastly, we need to run system-wide updates again and then install Odoo.

sudo apt update 

4. Install Odoo 15 on Ubuntu 20.04

To install Odoo run the following command.

sudo apt install odoo -y
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease                                                                         
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease                                                                 
Hit:4 http://deb.debian.org/debian bullseye-backports InRelease                                                               
Ign:5 http://nightly.odoo.com/15.0/nightly/deb ./ InRelease                                                                   
Get:6 http://nightly.odoo.com/15.0/nightly/deb ./ Release [1188 B]                                                            
Get:7 http://nightly.odoo.com/15.0/nightly/deb ./ Release.gpg [833 B]
Hit:8 https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease
Get:9 http://nightly.odoo.com/15.0/nightly/deb ./ Packages [2098 B]
Fetched 4119 B in 1s (3465 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Now we can check the status of Odoo to confirm if it is running or not.

systemctl status odoo
● odoo.service - Odoo Open Source ERP and CRM
     Loaded: loaded (/lib/systemd/system/odoo.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-04-13 05:40:30 UTC; 10min ago
   Main PID: 22778 (odoo)
      Tasks: 4 (limit: 1132)
     Memory: 79.0M
        CPU: 1.143s
     CGroup: /system.slice/odoo.service
             └─22778 /usr/bin/python3 /usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log

Apr 13 05:40:30 debian systemd[1]: Started Odoo Open Source ERP and CRM.

We need to enable Odoo to start automatically every time we boot up.

systemctl enable odoo --now
Synchronizing state of odoo.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable odoo

Odoo listens on TCP port 8069. We can confirm that with the following command.

ss -tunelp | grep 8069
tcp   LISTEN 0      128          0.0.0.0:8069      0.0.0.0:*    users:(("odoo",pid=22778,fd=5)) uid:109 ino:38497 sk:5 cgroup:/system.slice/odoo.service <->       

To login into Odoo use the following on your browser.

http://:8069
Odoo Login
Odoo Dashboard

When you login to Odoo for the first time you will find that the connection is not secure. What we will do is install an SSL certificate in order to make our connection secure.

Conclusion

We have successfully installed Odoo on Debian 11, what remains is the SSL certificate for production-ready sites. I will tackle that next.

How to install Vesta Control Panel on Ubuntu 18.04

Vesta Control Panel is a simple and clever web hosting control panel. It has the fine touch of Softaculus auto installer that is able to install more than 439 apps with one click. It also supports a great ton of features such as a built-in command-line interface, and Softaculus which you can focus on using the apps rather than installing. Has support for commercial plugins such as SFTP Chroot.

In this tutorial, I will take you through the installation and configuration of the Vesta control panel step by step.

Why Vesta Control Panel

Maybe you are wondering why Vesta control panel and not others. Vesta offers the following advantages.

  • Vesta web interface is extremely first couple with its first keyboard shortcuts.
  • Sites powered by vesta are fast because vesta delivers optimized configurations for low, medium, and high RAM server types.
  • Vesta requires low resources and still runs fast. 512 Mb RAM, 20Gb hard disk, and 1Ghz CPU are enough to power Vesta resources.
  • It has a built-in firewall that resolves all common issues.
  • It has supported internationalization. It supports more than 25 languages and regions around the globe.
  • It provides monitoring and logging of server requests.
  • It has an out-of-the-box backup system implemented by daily cron jobs.

Install Vesta Control Panel on Ubuntu 18.04

1. Connect to your server

First, we need to connect to our Ubuntu server via ssh console like this

ssh root@

2. Update system repositories.

Secondly, we need to update our system repositories in order to make them up to date. This will ensure that we don’t run into errors later during our installation.

sudo apt update && apt upgrade -y

3. Download Vesta Control Panel

We are going to use the vesta installation script to run our installation. This is a very convenient method as all the vesta requirements are included in the script.

sudo curl -O http://vestacp.com/pub/vst-install.sh

Then to run the script in order to install Vesta use the following command.

bash vst-install.sh

Error: group admin exists

Please remove admin group before proceeding.
If you want to do it automatically run installer with -f option:
Example: bash vst-install.sh --force

If the installation fails for some reason like the one shown above, you can do –force installation like this.

bash vst-install.sh --force 

You will get an output like this:

#output
_|      _|  _|_|_|_|    _|_|_|  _|_|_|_|_|    _|_|
 _|      _|  _|        _|            _|      _|    _|
 _|      _|  _|_|_|      _|_|        _|      _|_|_|_|
   _|  _|    _|              _|      _|      _|    _|
     _|      _|_|_|_|  _|_|_|        _|      _|    _|

                                  Vesta Control Panel



The following software will be installed on your system:
   - Nginx Web Server
   - Apache Web Server (as backend)
   - Bind DNS Server
   - Exim Mail Server
   - Dovecot POP3/IMAP Server
   - MySQL Database Server
   - Vsftpd FTP Server
   - Softaculous Plugin
   - Iptables Firewall + Fail2Ban


Would you like to continue [y/n]: 

Press Y to allow the installation to continue. You need to provide your admin email and FQDN for the installation to continue.

Please enter admin email address: next@gmail.com
Please enter Vesta port number (press enter for 8083): 
Please enter FQDN hostname [ubuntu]: next-example.com
Installation backup directory: /root/vst_install_backups/1649527203




Installation will take about 15 minutes ...

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--2022-04-09 18:00:09--  http://nginx.org/keys/nginx_signing.key
Resolving nginx.org (nginx.org)... 52.58.199.22, 3.125.197.172, 2a05:d014:edb:5702::6, ...
Connecting to nginx.org (nginx.org)|52.58.199.22|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1561 (1.5K) [application/octet-stream]
Saving to: ‘/tmp/nginx_signing.key’

when don with installation visit http:///8083 on your terminal to access its interface. Use the credentials given.

Thank you for using Softaculous
=======================================================

 _|      _|  _|_|_|_|    _|_|_|  _|_|_|_|_|    _|_|   
 _|      _|  _|        _|            _|      _|    _| 
 _|      _|  _|_|_|      _|_|        _|      _|_|_|_| 
   _|  _|    _|              _|      _|      _|    _| 
     _|      _|_|_|_|  _|_|_|        _|      _|    _| 


Congratulations, you have just successfully installed Vesta Control Panel

    https://138.68.177.91:8083
    username: admin
    password: knCoRJpPqb

We hope that you enjoy your installation of Vesta. Please feel free to contact us anytime if you have any questions.
Thank you.

--
Sincerely yours
vestacp.com team
Vesta CP login
Vesta CP Dashboard

4. Uninstall Vesta Control Panel

When you want to uninstall Vesta CP the first thing to do is to stop vesta services like this;

service vesta stop

After you have stopped the service then proceed to remove the installation like this:

sudo apt remove vesta*
rm -f /etc/apt/sources.list.d/vesta.list

Lastly, remove the data directory and its associated cron jobs.

rm -rf /usr/local/vesta

How to Install and Enable SSH server on Fedora 35

Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Notably used for remote logins and command-line execution. SSH protects the privacy and integrity of the transferred data or files over a network. It helps block sniffing attacks on the network. In this tutorial, I will show you how to install and enable the SSH server on fedora 35.

Before we can install the SSH server, we first need to understand how this server works. It mostly works on the client/server model. The SSH client initiates the setup of a secure connection and the SSH server listens to the incoming connection on TCP port 22 and makes a response. The server then authenticates itself to the client by providing the public key. This allows the client to know it is communicating with the correct server.

Most Linux systems come with pre-installed open-source OpenSSH. OpenSSH is developed as part of the OpenBSD project.

OpenSSH comes with the following command-line utilities and daemon.

  • Secure Copy Protocol (SCP)
  • Secure File Transfer Protocol (SFTP)
  • SSH
  • SSH-add and SSH-agent
  • SSH-keygen
  • SSH-keyscan

Install OpenSSH on Fedora 35

First, we need to log in as root to perform this operation. and then update your system repositories.

dnf update -y

1. Check the OpenSSH file directory

When the updates are complete, proceed to check if Openssh is in your default Fedora 35 repositories.

rpm -qa | grep openssh-server
openssh-server-8.7p1-3.fc35.x86_64

If it happens that you don’t see the output, as shown above, then you need to proceed and install them.

2. Install OpenSSH-server on Fedora 35.

To install openssh-server you need to run the following command on your terminal as root.

dnf -y install openssh-server
Package openssh-server-8.7p1-3.fc35.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

3. Configuring an OpenSSH

Enable Openssh to start on boot

If you check the status of the sshd service now you will find that the service isn’t running, so we need to enable it first then start the service.

sudo systemctl enable sshd

After you have enabled it, you need to start the service

sudo systemctl start sshd

Lastly, you need to check the status if sshd is actually running.

sudo systemctl status sshd.
● sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-04-04 08:50:25 UTC; 1min 51s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 14899 (sshd)
      Tasks: 1 (limit: 1112)
     Memory: 1.1M
        CPU: 102ms
     CGroup: /system.slice/sshd.service
             └─14899 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Apr 04 08:50:25 fedora sshd[14899]: Server listening on 0.0.0.0 port 22.
Apr 04 08:50:25 fedora sshd[14899]: Server listening on :: port 22.
Apr 04 08:50:32 fedora sshd[17488]: Invalid user zeg from 20.84.65.175 port 33352
Apr 04 08:50:32 fedora sshd[17488]: Received disconnect from 20.84.65.175 port 33352:11: Bye Bye [preauth]
Apr 04 08:50:32 fedora sshd[17488]: Disconnected from invalid user zeg 20.84.65.175 port 33352 [preauth]
Apr 04 08:50:37 fedora sshd[19004]: Invalid user drikesmedia from 201.217.195.226 port 51452
Apr 04 08:50:37 fedora sshd[19004]: Received disconnect from 201.217.195.226 port 51452:11: Bye Bye [preauth]
Apr 04 08:50:37 fedora sshd[19004]: Disconnected from invalid user drikesmedia 201.217.195.226 port 51452 [preauth]

To stop running sshd daemon issue the following command.

sudo systemctl stop sshd

If you check the status again you should be able to see status not active.

systemctl status sshd
○ sshd.service - OpenSSH server daemon
     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Mon 2022-04-04 08:59:29 UTC; 1min 13s ago
       Docs: man:sshd(8)
             man:sshd_config(5)
    Process: 14899 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 14899 (code=exited, status=0/SUCCESS)
        CPU: 533ms

Apr 04 08:57:17 fedora sshd[19043]: Invalid user dziq from 40.121.14.28 port 54990
Apr 04 08:57:17 fedora sshd[19043]: Received disconnect from 40.121.14.28 port 54990:11: Bye Bye [preauth]
Apr 04 08:57:17 fedora sshd[19043]: Disconnected from invalid user dziq 40.121.14.28 port 54990 [preauth]
Apr 04 08:59:28 fedora sshd[19046]: Invalid user abe from 188.166.243.218 port 35016
Apr 04 08:59:28 fedora sshd[19046]: Received disconnect from 188.166.243.218 port 35016:11: Bye Bye [preauth]
Apr 04 08:59:28 fedora sshd[19046]: Disconnected from invalid user abe 188.166.243.218 port 35016 [preauth]
Apr 04 08:59:29 fedora sshd[14899]: Received signal 15; terminating.
Apr 04 08:59:29 fedora systemd[1]: Stopping OpenSSH server daemon...
Apr 04 08:59:29 fedora systemd[1]: sshd.service: Deactivated successfully.
Apr 04 08:59:29 fedora systemd[1]: Stopped OpenSSH server daemon.

If you try connecting to a remote server you will see the following. I am using ubutnu 20.04 desktop to connect to my Fedora 35 server.

ssh root@139.59.138.27

The root is the account am in and 139.59.138.27 is the IP address of my Fedora 35 server.

SSH connection

4. Requiring SSH remote connections

For SSH to be effective, you don’t need to use an insecure connection. Disable the following services: telnet, rsh, rlogin and VSFTP.

Even though these services are not installed on Fedora by default, we need to make sure it is not running for sure. Stop them using the following commands.

sudo systemctl stop telnet
sudo systemctl stop rsh
sudo systemctl stop rlogin
sudo systemctl stop vsftp

And if you want to disable these services from running from start-up do the following:

sudo systemctl disable telnet
sudo systemctl disable rsh
sudo systemctl disable rlogin
sudo systemctl disable vsftp

Conclusion

To wrap it up SSHing is two-way traffic that creates a request, and gets back the request signal from the server. And you have to create an SSH key pair on your system first to enable you to ssh into another host.