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 Thu 2022-06-16 21:35:07 UTC; 4s ago\r\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n Process: 297440 ExecStart=\/usr\/sbin\/apachectl start (code=exited, status=0\/SUCCESS)\r\n Main PID: 297445 (apache2)\r\n Tasks: 55 (limit: 4579)\r\n Memory: 5.1M\r\n CPU: 315ms\r\n CGroup: \/system.slice\/apache2.service\r\n \u251c\u2500297445 \/usr\/sbin\/apache2 -k start\r\n \u251c\u2500297446 \/usr\/sbin\/apache2 -k start\r\n \u2514\u2500297447 \/usr\/sbin\/apache2 -k start\r\n\r\nJun 16 21:35:07 host.test.vps systemd[1]: Starting The Apache HTTP Server...\r\n<\/pre>\n<\/span>Step 3. Install PHP7.4 with dependencies<\/span><\/h2>\nTo install the PHP7.4 along with extensions, execute the following command:<\/p>\n
apt install software-properties-common apt-transport-https -y\r\n\r\nadd-apt-repository ppa:ondrej\/php -y\r\n\r\nsudo apt update\r\n\r\napt install php7.4 php7.4-common libapache2-mod-php7.4 php7.4-cli php7.4-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@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 Thu 2022-06-16 21:38:39 UTC; 37s ago\r\n Docs: man:mariadbd(8)\r\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\r\n Main PID: 298238 (mariadbd)\r\n Status: \"Taking your SQL requests now...\"\r\n Tasks: 16 (limit: 4579)\r\n Memory: 57.2M\r\n CPU: 3.487s\r\n CGroup: \/system.slice\/mariadb.service\r\n \u2514\u2500298238 \/usr\/sbin\/mariadbd\r\n<\/pre>\n