The Apache web server is written and developed in C and used to accept requests from clients and send a response that the client requested before. To install the Apache Web server execute the following command:<\/p>\n
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@vps:~# 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 Sat 2022-05-14 14:26:56 UTC; 2 days ago\r\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n Main PID: 660 (apache2)\r\n Tasks: 8 (limit: 4566)\r\n Memory: 21.3M\r\n CPU: 21.761s\r\n CGroup: \/system.slice\/apache2.service\r\n \u251c\u2500 660 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035101 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035102 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035103 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035104 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035105 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250035106 \/usr\/sbin\/apache2 -k start\r\n \u2514\u250035108 \/usr\/sbin\/apache2 -k start\r\n\r\nMay 14 14:26:56 host.test.vps systemd[1]: Starting The Apache HTTP Server...<\/pre>\n<\/span>Step 3. Install PHP8.1 with dependencies<\/span><\/h2>\nThe Next software of the LAMP stack is the PHP along with its extensions. To 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 libapache2-mod-php\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@vps:~# 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; 33s 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: 16 (limit: 4566)\r\n Memory: 57.2M\r\n CPU: 3.249s\r\n CGroup: \/system.slice\/mariadb.service\r\n \u2514\u250042716 \/usr\/sbin\/mariadbd\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