moving a friendica VPS server onto ubuntu 22.04 LTS
@Friendica Support @Friendica Admins
Based on the tutorial "creating a friendica server - ubuntu" by @Hank G ☑️.
IntroductionHi, I'm working on my first #friendica #VPS installation, here you'll find my [ initial post about general thoughts](squeet.me/display/962c3e10-196…) like what distro to use, size and costs. As of now I'm doing well in the process and want to start this post to document differences and questions while installing the server. This server is going to host an already existing friendica node I have to move from another hosting provider. That means that for example the DB doesn't have to be created from scratch but moved and other smaller details. I will try to address the different steps of installation in answers to this post and appreciate help, ideas and observations.
Server specs and friendica version used:
VPS server | Ubuntu 22.04 LTS
PHP Version 8.1.2-1ubuntu2.14
4 Core CPU, 8 GB Ram with 300GB NVME Disk
Friendica [STABLE] | 'Giant Rhubarb' 2023.05 - 1518
Installation environmentThe only reasonable way to work with a VPSserver on the web is using the console. If you are not familiar with that don't worry, it is easy and the only thing you have to do is being able to copy/paste the commands displayed. On the console you wont be able to copy/paste with the keyboard ctrl-C/ctrl-V technique, you'll have to use the mouse "right click, chose option" technique. This tutorial was created on a #debian #linux desktop environment. There shouldn't be differences if you want to do this from a #windows machine. The method used for communication between your local computer and the VPS server is called #SSH: *Wikipedia - Secure Shell: "Cryptographic network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers."*
Basic definitions for to work with the console:
user@localPC:~$ ----------------> your computer
rootname@VPShosting:~# ---> your VPS server
www-data@VPShosting:~$ --> the user name of the friendica installation on the apache VPS server
#fediVerse #tutorial #fediHelp #activityPub
@TupambAdmin [stable] @Tutorial
Diese Webseite verwendet Cookies. Durch die weitere Benutzung der Webseite stimmst du dieser Verwendung zu. https://inne.city/tos
…ᘛ⁐̤ᕐᐷ jesuisatire bitPickup
Als Antwort auf …ᘛ⁐̤ᕐᐷ jesuisatire bitPickup • • •"M" like MySQL/mariaDB and "P" like PHP of "LAMP" installation
DataBase and PHP-HypertextPreprocessor installation
Values for the prompts you get:Enter current password for root (enter for none): Just hit enter since you are configured to only allow logins with SSH keys for the root user.
Switch to unix_socket authentication: n
Change the root password?: n
Remove anonymous users? Y
Disallow root login remotely? Y
Remove test database and access to it? Y
Reload privilege tables now? Y[/list]
rootname@VPShosting:~$
sudo apt update
rootname@VPShosting:~$
sudo apt install mariadb-server php libapache2-mod-php \ php-common php-gmp php-curl php-intl php-mbstring \ php-xmlrpc php-mysql php-gd php-imagick php-xml \ php-cli php-zip php-sqlite3 curl git -y
rootname@VPShosting:~$
sudo mysql_secure_installation
…ᘛ⁐̤ᕐᐷ jesuisatire bitPickup
Als Antwort auf …ᘛ⁐̤ᕐᐷ jesuisatire bitPickup • • •handling/typing errors
Somehow I managed to mistype something here and got stuck.The console gave me the following message:
Disallow root login remotely? [Y/n] ^C <- (some bad keystroke)
Aborting!
Cleaning up...
root@ubuntu:~#
So I just started again:
sudo mysql_secure_installation
The following lines came up and after just redoing the same steps apparently everything went fine.
Zum Öffnen/Schließen klicken
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures
handling/typing errors
Somehow I managed to mistype something here and got stuck.The console gave me the following message:
Disallow root login remotely? [Y/n] ^C <- (some bad keystroke)
Aborting!
Cleaning up...
root@ubuntu:~#
So I just started again:
sudo mysql_secure_installation
The following lines came up and after just redoing the same steps apparently everything went fine.
Zum Öffnen/Schließen klicken
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] n
... skipping.
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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? [Y/n] 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? [Y/n] y
... Success!
..
.. and so on..
…ᘛ⁐̤ᕐᐷ jesuisatire bitPickup
Als Antwort auf …ᘛ⁐̤ᕐᐷ jesuisatire bitPickup • • •Creating the DB - data base
If you come to this point straight from the previous mariaDB setup you are already logged into mySQL. You will note this because instead of the print:rootname@VPShosting:~#
in the console you will see:
MariaDB [(none)]>
Other wise you will have to log into mariaDB first with the following command:
rootname@VPShosting:~#
mysql
mariaDB welcome message:
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 160000
Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
... mehr anzeigenCREATE DATABASE friendicadb;
MariaDB [(none)]>
CREATE USER 'friendica'@'localhost' IDENTIFIED BY '<password>';
MariaDB [(none)]>
GRANT ALL ON friendicadb
Creating the DB - data base
If you come to this point straight from the previous mariaDB setup you are already logged into mySQL. You will note this because instead of the print:rootname@VPShosting:~#
in the console you will see:
MariaDB [(none)]>
Other wise you will have to log into mariaDB first with the following command:
rootname@VPShosting:~#
mysql
mariaDB welcome message:
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 160000
Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
CREATE DATABASE friendicadb;
MariaDB [(none)]>
CREATE USER 'friendica'@'localhost' IDENTIFIED BY '<password>';
MariaDB [(none)]>
GRANT ALL ON friendicadb.* TO 'friendica'@'localhost';
MariaDB [(none)]>
FLUSH PRIVILEGES;
MariaDB [(none)]>
EXIT;
rootname@VPShosting:~#
To log from the console into your DB use the following command:
rootname@VPShosting:~#
mysql friendicadb
To exit mariaDB:
MariaDB [friendicadb]>
Ctrl-C
-- exit!Aborted
rootname@VPShosting:~#
…ᘛ⁐̤ᕐᐷ jesuisatire bitPickup
Als Antwort auf …ᘛ⁐̤ᕐᐷ jesuisatire bitPickup • • •