Drupal is a popular content management system (CMS) that is used to build websites and web applications. In this article, we will guide you through the process of installing Drupal on Alma Linux 9.
Step 1: Update your system
Before installing Drupal, it is recommended to update your system to make sure you have the latest packages. You can do this by running the following command:
sudo dnf update
Step 2: Install LAMP stack
Drupal requires a LAMP (Linux, Apache, MySQL, PHP) stack to run. You can install the LAMP stack on Alma Linux by running the following command:
sudo dnf install httpd mariadb-server php php-mysqlnd
After installing the packages, start and enable the Apache and MariaDB services:
sudo systemctl start httpd
sudo systemctl enable httpd
sudo systemctl start mariadb
sudo systemctl enable mariadb
Step 3: Secure MariaDB
Next, you will need to secure your MariaDB installation by running the following command:
sudo mysql_secure_installation
Follow the on-screen prompts to set a root password, remove anonymous users, restrict root login, and remove test databases.
Step 4: Create a database for Drupal
Now, you need to create a database and user for Drupal. Log in to the MariaDB shell:
sudo mysql -u root -p
Enter your root password when prompted. Then, create a new database and user:
CREATE DATABASE drupaldb;
CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON drupaldb.* TO 'drupaluser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Step 5: Download and extract Drupal
Download the latest version of Drupal from the official website or using the following command:
wget https://www.drupal.org/download-latest/tar.gz
Extract the downloaded file to the Apache web directory:
sudo tar -xvzf drupal-*.tar.gz -C /var/www/html
Rename the Drupal directory to a more readable name:
sudo mv /var/www/html/drupal-* /var/www/html/drupal
Step 6: Configure Drupal
Create a settings file by copying the default settings file:
sudo cp /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php
Set the appropriate permissions on the files directory:
sudo chown -R apache:apache /var/www/html/drupal/sites/default/files
Restart the Apache service for the changes to take effect:
sudo systemctl restart httpd
Step 7: Access Drupal installation
Finally, open a web browser and navigate to your server’s IP address or domain followed by /drupal. You will be greeted by the Drupal installation wizard. Follow the prompts to complete the installation process.
That’s it! You have successfully installed Drupal on Alma Linux 9. You can now start building your website or web application using this powerful CMS.