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 Fri 2022-06-17 16:10:39 UTC; 1 day 3h ago\r\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\r\n Main PID: 667 (apache2)\r\n Tasks: 9 (limit: 4579)\r\n Memory: 22.1M\r\n CPU: 14.658s\r\n CGroup: \/system.slice\/apache2.service\r\n \u251c\u2500 667 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024399 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024400 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024401 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024402 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024403 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024404 \/usr\/sbin\/apache2 -k start\r\n \u251c\u250024405 \/usr\/sbin\/apache2 -k start\r\n \u2514\u250024406 \/usr\/sbin\/apache2 -k start\r\n\r\nJun 17 16:10:38 host.test.vps systemd[1]: Starting The Apache HTTP Server...<\/pre>\n<\/span>Step 3. Install PHP8.1 with dependencies<\/span><\/h2>\nTo install PHP8.1 with extensions, execute the following commands:<\/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@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 Sat 2022-06-18 19:25:52 UTC; 1min 2s ago\r\n Docs: man:mariadbd(8)\r\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\r\n Main PID: 44866 (mariadbd)\r\n Status: \"Taking your SQL requests now...\"\r\n Tasks: 9 (limit: 4579)\r\n Memory: 57.0M\r\n CPU: 3.498s\r\n CGroup: \/system.slice\/mariadb.service\r\n \u2514\u250044866 \/usr\/sbin\/mariadbd\r\n<\/pre>\n<\/span>Step 5. Create Drupal Database and User<\/span><\/h2>\nNext, we need to create a Drupal database, a Drupal user, and grant the permissions for that user to the database.<\/p>\n
CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';\r\n CREATE DATABASE drupal;\r\n GRANT ALL PRIVILEGES ON drupal.* TO 'drupal'@'localhost';\r\n FLUSH PRIVILEGES;\r\n EXIT;\r\n<\/pre>\n