Drupal is a popular Content Management System (CMS) that allows businesses and individuals to create, maintain, and publish websites. With its open-source nature and a supportive community, Drupal has become the go-to choice for millions of users worldwide. In this guide, we will walk you through the process of installing Drupal on Rocky Linux 8, ensuring a seamless setup for your website.
1. Introduction
Before we dive into the installation process, let’s have a brief overview of what Drupal is and why it’s a popular choice for website development. Drupal is a robust CMS that offers a wide range of features and functionalities, making it suitable for both small websites and large-scale enterprise applications. Its flexibility, scalability, and extensive module library make it a preferred choice among developers and content creators.
2. Updating the System
Before installing any software, it’s crucial to ensure that your system is up to date with the latest packages and security patches. To update Rocky Linux 8, open the terminal and run the following command:
yum update -y
This command will update all the installed packages on your system to their latest versions.
3. Installing MariaDB Server
MariaDB is a popular open-source relational database management system that is compatible with MySQL. Drupal requires a database to store its content and configuration. To install MariaDB on Rocky Linux 8, run the following command in the terminal:
dnf -y install @mariadb
This command will install the MariaDB server along with its dependencies.
4. Securing the Database Server
After installing the MariaDB server, it’s essential to secure it by setting a root password, disabling remote root logins, and removing test databases. To secure the database server, run the following command:
mysql_secure_installation
This command will launch an interactive script that will guide you through the process of securing the MariaDB server.
5. Installing PHP and Extensions
Drupal is built using PHP, a popular server-side scripting language. To install PHP and its required extensions, run the following commands in the terminal:
dnf module -qy reset php dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm dnf module install php:remi-8.0 -y dnf -y install php php-{cli,fpm,gd,mysqlnd,mbstring,json,common,dba,dbg,devel,embedded,enchant,bcmath,gmp,intl,ldap,odbc,pdo,opcache,pear,pgsql,process,snmp,soap,xml,xmlrpc,opcache}
These commands will install PHP 8.0 and the necessary extensions required by Drupal.
6. Installing Apache Webserver
Drupal also requires a web server to serve its web pages. Apache is a popular choice for hosting Drupal websites. To install Apache on Rocky Linux 8, run the following command:
dnf -y install httpd
This command will install the Apache web server on your system.
7. Downloading and Installing Drupal
Now that you have installed the necessary software, it’s time to download and install Drupal. Follow these steps:
- Download the latest version of Drupal by running the following command:
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
- Extract the downloaded file using the following command:
tar xvf drupal.tar.gz
- Move the extracted Drupal files to the webserver’s document root directory:
mv drupal-* /var/www/html/drupal
8. Configuring Drupal
After installing Drupal, it’s time to configure it. Follow these steps:
- Set the appropriate file permissions to allow Apache to access the Drupal files:
chown -R apache:apache /var/www/html/drupal chmod -R 755 /var/www/html/drupal
- Create additional files required for the Drupal installer:
mkdir /var/www/html/drupal/sites/default/files cp /var/www/html/drupal/sites/default/default.settings.php /var/www/html/drupal/sites/default/settings.php
9. Configuring Apache Web Server for Drupal
To configure Apache web server for Drupal, create a virtual host configuration file using your preferred text editor:
vi /etc/httpd/conf.d/drupal.conf
Copy and paste the following content into the file:
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/html/drupal/
<Directory /var/www/html/drupal>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
</VirtualHost>
Make sure to replace mysite.com
, www.example.com
, and admin@example.com
with your actual domain name and email address.
10. Restarting Apache Web Server
After configuring the virtual host, restart the Apache web server for the changes to take effect:
systemctl restart httpd
11. Checking and Installing Drupal from the Browser
Now that everything is set up, you can access the Drupal configuration page from your web browser. Open your browser and enter the following URL:
http://example.com
Replace example.com
with your actual domain name.
Follow the on-screen instructions to select an installation profile, configure the database for Drupal, and complete the installation process.
12. Conclusion
Congratulations! You have successfully installed Drupal on Rocky Linux 8. You can now start building your website using Drupal’s powerful features and customizations. If you encounter any issues or have any questions, feel free to reach out to our technical support team at Shape.host. We offer Linux SSD VPS hosting solutions with exceptional performance and reliable support to help you succeed in your online ventures.