One place for hosting & domains

      Quickstart

      Installieren von MariaDB unter Ubuntu 20.04 [Quickstart]


      Eine frühere Version dieses Tutorials wurde von Brian Boucheron geschrieben

      Einführung

      MariaDB ist ein Open-Source-basiertes relationales Datenbank-Managementsystem, das häufig als Alternative für den MySQL-Datenbankteil des beliebten LAMP-Stacks (Linux, Apache, MySQL, PHP/Python/Perl) verwendet wird. Es ist als Drop-in-Ersatz für MySQL gedacht.

      Dieses Quickstart-Tutorial beschreibt, wie Sie MariaDB auf einem Ubuntu 20.04-Server installieren und es mit einer sicheren Erstkonfiguration einrichten. Es behandelt außerdem, wie Sie ein zusätzliches Administratorkonto für den Passwortzugriff einrichten.

      Voraussetzungen

      Um diesem Tutorial folgen zu können, benötigen Sie einen Server, auf dem Ubuntu 20.04 ausgeführt wird. Dieser Server sollte über einen administrativen non-root user und eine mit UFW konfigurierte Firewall verfügen. Sie können dies einrichten, indem Sie unserem Leitfaden zur Ersteinrichtung des Servers für Ubuntu 20.04 folgen.

      Schritt 1 — Installieren von MariaDB

      Bevor Sie MariaDB installieren, aktualisieren Sie mit apt den Paketindex auf Ihrem Server:

      Installieren Sie anschließend das Paket:

      • sudo apt install mariadb-server

      Bei Installation aus den Standard-Repositorys startet die Ausführung von MariaDB automatisch. Um dies zu testen, überprüfen Sie seinen Status.

      • sudo systemctl status mariadb

      Sie erhalten eine Ausgabe, die der folgenden ähnelt:

      Output

      ● mariadb.service - MariaDB 10.3.22 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2020-05-12 13:38:18 UTC; 3min 55s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 25914 (mysqld) Status: "Taking your SQL requests now..." Tasks: 31 (limit: 2345) Memory: 65.6M CGroup: /system.slice/mariadb.service └─25914 /usr/sbin/mysqld . . .

      Wenn MariaDB nicht ausgeführt wird, können Sie das System mit dem Befehl sudo systemctl start mariadb starten.

      Schritt 2 — Konfigurieren von MariaDB

      Führen Sie das Sicherheitsskript aus, das mit MariaDB installiert wurde. Dieses Skript führt Sie durch eine Reihe von Aufforderungen, in denen Sie verschiedene Änderungen an den Sicherheitseinstellungen Ihrer MySQL-Installation vornehmen können:

      • sudo mysql_secure_installation

      Bei der ersten Eingabeaufforderung werden Sie gebeten, das aktuelle Datenbank-root-Passwort einzugeben. Da wir noch kein Passwort eingerichtet haben, drücken Sie ENTER, um „none“ (keines) anzugeben.

      Output

      . . . Enter current password for root (enter for none):

      Bei der nächsten Eingabeaufforderung werden Sie gefragt, ob Sie ein Datenbank-root-Passwort einrichten möchten. Bei Ubuntu ist das root-Konto für MariaDB eng mit der automatisierten Systemwartung verbunden. Daher sollten wir die für dieses Konto konfigurierten Authentifizierungsmethoden nicht ändern. Geben Sie N ein und drücken Sie dann ENTER.

      Output

      . . . Set root password? [Y/n] N

      Danach können Sie Y und dann ENTER drücken, um die Standardeinstellungen für alle nachfolgenden Fragen zu akzeptieren. Damit werden einige anonyme Benutzer und die Testdatenbank entfernt, Remote-root-Logins deaktiviert und dann diese neuen Regeln geladen.

      Schritt 3 — (Optional) Erstellen eines administrativen Benutzers, der Passwortauthentifizierung verwendet

      Bei Ubuntu mit MariaDB 10.3 ist der root-MariaDB-Benutzer standardmäßig so eingerichtet, dass die Authentifizierung mit dem unix_socket-Plugin und nicht mit einem Passwort vorgenommen wird. Da der Server das root-Konto für Aufgaben wie Protokollrotation sowie Starten und Anhalten des Servers nutzt, ist es am besten, die Authentifizierungsdaten des root-Kontos nicht zu ändern. Stattdessen empfehlen die Paketverwalter die Erstellung eines separaten Administratorkontos für passwortbasierten Zugriff.

      Öffnen Sie dazu die MariaDB-Eingabeaufforderung in Ihrem Terminal:

      Erstellen Sie dann einen neuen Benutzer mit root-Berechtigungen und passwortbasiertem Zugriff. Achten Sie darauf, den Benutzernamen und das Passwort entsprechend Ihren Präferenzen zu ändern:

      • GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

      Bestätigen Sie die Berechtigungen, um sicherzustellen, dass sie in der aktuellen Sitzung gespeichert und verfügbar sind:

      Beenden Sie anschließend die MariaDB Shell:

      Sie können diesen neuen Benutzer mit dem Tool mysqladmin testen. Das ist ein Client, der Sie administrative Befehle ausführen lässt. Der folgende mysqladmin-Befehl stellt eine Verbindung zu MariaDB als admin-Benutzer her und gibt die Versionsnummer aus, nachdem der Benutzer zur Eingabe seines Passworts aufgefordert wurde:

      • mysqladmin -u admin -p version

      Sie erhalten eine ähnliche Ausgabe wie diese:

      Output

      mysqladmin Ver 9.1 Distrib 10.3.22-MariaDB, for debian-linux-gnu on x86_64 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Server version 10.3.22-MariaDB-1ubuntu1 Protocol version 10 Connection Localhost via UNIX socket UNIX socket /var/run/mysqld/mysqld.sock Uptime: 4 min 49 sec Threads: 7 Questions: 467 Slow queries: 0 Opens: 177 Flush tables: 1 Open tables: 31 Queries per second avg: 1.615

      Zusammenfassung

      In diesem Leitfaden haben Sie das relationale Datenbankmanagementsystem MariaDB installiert und es mit dem Skript mysql_secure_installation gesichert, das mit dem System installiert wird. Sie hatten die Möglichkeit, einen neuen administrativen Benutzer zu erstellen, der die Passwortauthentifizierung verwendet.

      Nachdem Sie nun über einen laufenden und sicheren MariaDB-Server verfügen, finden Sie hier einige Beispiele für nächste Schritte, die Ihnen das Arbeiten mit dem Server erlauben:



      Source link

      How To Install Docker Compose on Ubuntu 20.04 [Quickstart]


      Introduction

      In this quickstart guide, we’ll install Docker Compose on an Ubuntu 20.04 server.

      For a more detailed version of this tutorial, with more explanations of each step, please refer to How To Install and Use Docker Compose on Ubuntu 20.04.

      Prerequisites

      To follow this guide, you’ll need access to an Ubuntu 20.04 server or local machine as a sudo user, and Docker installed on this system.

      Step 1 — Download Docker Compose

      Start by confirming the most recent Docker Compose release available in their releases page. At the time of this writing, the most current stable version is 1.26.0.

      Run the following command to download Docker Compose and make this software globally accessible on your system as docker-compose:

      • sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

      Step 2 — Set Up Executable Permissions

      Next, set the correct permissions to make sure the docker-compose command is executable:

      • sudo chmod +x /usr/local/bin/docker-compose

      To verify that the installation was successful, run:

      You’ll see output similar to this:

      Output

      docker-compose version 1.26.0, build 8a1c60f6

      Docker Compose is now successfully installed on your system.

      Here are links to more detailed guides related to this tutorial:



      Source link

      How To Install Git from Source on Ubuntu 20.04 [Quickstart]


      Introduction

      Version control systems help you collaborate on software development projects. Git is one of the most popular version control systems currently available.

      This tutorial will walk you through installing and configuring Git from source on an Ubuntu 20.04 server. For a more detailed version of this tutorial, with more thorough explanations of each step, please refer to How To Install Git on Ubuntu 20.04.

      Step 1 — Confirm Git PreInstallation

      Verify whether you have a version of Git currently installed on the server:

      If Git is installed, you’ll receive output similar to the following:

      Output

      git version 2.25.1

      Whether or not you have Git installed already, it is worth checking to make sure that you install a more recent version during this process.

      Step 2 — Update and Install Dependencies

      You’ll next need to install the software that Git depends on. This is all available in the default Ubuntu repositories, so we can update our local package index and then install the relevant packages.

      • sudo apt update
      • sudo apt install libz-dev libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext cmake gcc

      Press y to confirm if prompted. Necessary dependencies should now be installed.

      Step 3 — Install Tarball

      Create a temporary directory to download our Git tarball and move into it.

      From the Git project website, we can navigate to the tarball list available at https://mirrors.edge.kernel.org/pub/software/scm/git/ and download the version you would like. At the time of writing, the most recent version is 2.26.2, so we will download that for demonstration purposes. We’ll use curl and output the file we download to git.tar.gz.

      • curl -o git.tar.gz https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.26.2.tar.gz

      Step 4 — Unpack Compressed File and Install the Package

      Unpack the compressed tarball file:

      Next, move into the new Git directory:

      Now, you can make the package and install it by typing these two commands:

      • make prefix=/usr/local all
      • sudo make prefix=/usr/local install

      Now, replace the shell process so that the version of Git we just installed will be used:

      Step 5 — Verify New Version of Git

      You can be sure that your install was successful by checking the version.

      Output

      git version 2.26.2

      With Git successfully installed, you can now complete your setup.

      Step 6 — Set Up Git

      Now that you have Git installed and to prevent warnings, you should configure it with your information.

      • git config --global user.name "Your Name"
      • git config --global user.email "[email protected]"

      If you need to edit this file, you can use a text editor such as nano:

      ~/.gitconfig contents

      [user]
        name = Your Name
        email = [email protected]
      

      To learn more about how to use Git, check out these articles and series:



      Source link