sudo apt install apache2<\/pre>\nOnce installed, start and enable the service.<\/p>\n
sudo systemctl enable apache2 && sudo systemctl start apache2<\/pre>\nCheck if the service is up and running:<\/p>\n
sudo systemctl status apache2<\/pre>\nYou should receive the following output:<\/p>\n
root@host:~# sudo systemctl status apache2\r\n\u25cf apache2.service - The Apache HTTP Server\r\n Loaded: loaded (\/lib\/systemd\/system\/apache2.service; enabled; vendor preset: enabled)\r\n Active: active (running) since Tue 2022-05-17 22:03:46 UTC; 4 days ago\r\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n Main PID: 84157 (apache2)\r\n Tasks: 8 (limit: 4566)\r\n Memory: 33.2M\r\n CPU: 5min 21.702s\r\n CGroup: \/system.slice\/apache2.service\r\n \u251c\u2500 84157 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150719 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150720 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150721 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150722 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150723 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500150724 \/usr\/sbin\/apache2 -k start\r\n \u2514\u2500150943 \/usr\/sbin\/apache2 -k start\r\n\r\nMay 18 00:00:04 host.test.vps systemd[1]: Reloading The Apache HTTP Server...\r\n<\/pre>\n<\/span>Step 3. Install PHP8.1 with dependencies<\/span><\/h2>\nTo install the PHP8.1 along with extensions execute the following command:<\/p>\n
sudo apt-get install php8.1 php8.1-cli php8.1-common php8.1-imap php8.1-redis php8.1-snmp php8.1-xml php8.1-zip php8.1-mbstring php8.1-curl php8.1-gd php8.1-mysql\r\n<\/pre>\n<\/span>Step 4. Install MariaDB database server<\/span><\/h2>\nTo install the MariaDB database server, execute the command below.<\/p>\n
sudo apt install mariadb-server<\/pre>\nStart and enable the mariadb.service with the following commands:<\/p>\n
sudo systemctl start mariadb && sudo systemctl enable mariadb<\/pre>\nCheck the status of the mariadb.service<\/p>\n
sudo systemctl status mariadb<\/pre>\nYou should receive the following output:<\/p>\n
root@host:~# sudo systemctl status mariadb\r\n\u25cf mariadb.service - MariaDB 10.6.7 database server\r\n Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\r\n Active: active (running) since Mon 2022-05-16 19:40:12 UTC; 5 days ago\r\n Docs: man:mariadbd(8)\r\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\r\n Main PID: 42716 (mariadbd)\r\n Status: \"Taking your SQL requests now...\"\r\n Tasks: 7 (limit: 4566)\r\n Memory: 56.9M\r\n CPU: 2min 51.567s\r\n CGroup: \/system.slice\/mariadb.service\r\n \u2514\u250042716 \/usr\/sbin\/mariadbd\r\n\r\nMay 16 19:40:12 host.test.vps mariadbd[42716]: Version: '10.6.7-MariaDB-2ubuntu1' socket: '\/run\/mysqld\/mysqld.sock' port: 3306 Ubuntu 22.04\r\nMay 16 19:40:12 host.test.vps systemd[1]: Started MariaDB 10.6.7 database server.\r\n\r\n<\/pre>\nTo check the installed MariaDB database version you can execute the following command:<\/p>\n
mysql -V<\/pre>\nYou should receive the following output:<\/p>\n
root@vps:~# mysql -V\r\nmysql Ver 15.1 Distrib 10.6.7-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper\r\n<\/pre>\n