Good job! We have taken you through a step-by-step guide of how you can install Drupal on CentOS 8. And from now on you know How to install Drupal on CentOS 8.
Drupal is a free and open-source CMS written in PHP that ships with the GNU / GPL license. In this article, we will learn you How to install Drupal on CentOS 8.
Similar to popular CMS platforms such as WordPress and Joomla, with Drupal, you can get started with creating your own blog or website from the ground up with little or zero knowledge of web programming or markup languages.
Table of Contents
Before we get started, ensure that you have installed the LAMP stack on your CentOS 8. and also, ensure that you have an SSH connection to your CentOS 8 server and a good and stable internet connection.
How to install Drupal on CentOS 8
In this tutorial, you will learn how to install Drupal on CentOS 8 Linux.
Install Additional PHP Modules in CentOS 8
Since the Drupal requires additional PHP modules to function without a hitch install them by executing the command below.
sudo dnf install php-curl php-mbstring php-gd php-xml php-pear php-fpm php-mysql php-pdo php-opcache php-json php-zip
Create a Drupal Database
After installing all the required PHP modules, you need to create a database to accommodate Drupal’s installation files. So log in to your MariaDB database as shown.
sudo mysql -u root -p
To create a database for Drupal and grant all privileges on the Drupal user, run the following command when you are logged in.
MariaDB [(none)]> CREATE DATABASE drupal_db; MariaDB [(none)]> GRANT ALL ON drupal_db.* TO ‘drupal_user’@’localhost’ IDENTIFIED BY ‘StrongP@ssword’; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
You can exit and restart the database server.
sudo systemctl restart mariadb
Download Drupal in CentOS 8
With Drupal’s database in place, the next step will be downloading Drupal’s tarball file from Drupal’s official site. This contains all the necessary files required for Drupal to function as expected. At the time of writing this, the latest version is Drupal 8.8.4
sudo wget https://ftp.drupal.org/files/projects/drupal-8.8.4.tar.gz
So, extract the tarball file, when the download is completed.
sudo tar -xvf drupal-8.8.4.tar.gz
Now, move the extracted folder to the Apache document root directory.
sudo mv drupal-8.8.2 /var/www/html/drupal
Using the drupal uncompressed file in the document root directory, modify the file permissions to allow apache to access the directory.
sudo chown -R apache:apache /var/www/html/drupal
Configure Drupal Settings
In this step, create a settings file from the default settings file (default.settings.php) which already exists in the following location.
cd /var/www/html/drupal/sites/default sudo cp -p default.settings.php settings.php
If SELinux is enabled on your system, run the command below to effect the SELinux rule on the /var/www/html/drupal/ directory.
Finalizing Drupal Installation
While all the configurations are set, the only remaining bit is to set up Drupal on the browser. To do that, type the following address in your URL bar and hit ENTER.
The ‘Welcome’ screen will be as shown. But first, select your preferred language and click the ‘Save and Continue’ button.
On the following screen, select the ‘Standard Profile’ as the profile to be used and click the ‘Save and Continue’ button to proceed to the next page.
It is time to take a look at the overview of the requirements and enable clean URLs. To enable clean URLs, head out to the Apache configuration file located in the /etc/httpd/conf/httpd.conf file.
And set the AllowOverride attribute from None to All.
At this point, refresh the page to continue to the ‘Database Configuration’ page as shown. Fill out the required fields such as the database type, database name, database password, and username.
One more time, click on the ‘Save and Continue’ button to go to the next step. Drupal will commence installing all the features and will take about 5 minutes.
Fill out the following details:
And finally, you will be presented with the home page as shown. You can now proceed to create your site and add content to it. You can use a vast array of Drupal themes and plugins to enhance your site’s appearance.
Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problems in it.