How To Install Drupal CMS On Linux Mint 20.2

To Install Drupal CMS On Linux Mint 20.2

Introduction :

Drupal is a free and open-source web content management system written in PHP and distributed under the GNU General Public License. Drupal provides an open-source back-end framework for at least 14% of the top 10,000 websites worldwide – ranging from personal blogs to corporate, political, and government sites.

Installation procedure :

Step 1 : Check the OS Version by using the below command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 20.2
Release:	20.2
Codename:	uma

Step 2 : Install the PHP modules for downloading the Drupal CMS by using the below command

root@linuxhelp:~# apt install php php-xml php-mysql php-mbstring php-zip php-soap php-curl php-gd php-ldap php-imap php-common php-dev libmcrypt-dev php-pear
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php is already the newest version (2:7.4+75).
php-common is already the newest version (2:75).
php-common set to manually installed.
php-gd is already the newest version (2:7.4+75).
php-mysql is already the newest version (2:7.4+75).
php-mbstring is already the newest version (2:7.4+75).
php-zip is already the newest version (2:7.4+75).

Step 3 : Login to the mysql Root and create the database and users and then give permissions for installing the drupal CMS by using the below command

root@linuxhelp:~# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 36
Server version: 10.3.32-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> create database drupal;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> create user 'drupaluser'@localhost identified by '123456';
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> grant all privileges on drupal.* to 'drupaluser'@localhost identified by '123456';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> exit
Bye

Step 4 : Download the Drupal CMS by using the wget command

root@linuxhelp:~# wget https://www.drupal.org/download-latest/zip
--2022-01-29 03:45:24--  https://www.drupal.org/download-latest/zip
Resolving www.drupal.org (www.drupal.org)... 199.232.254.217
Connecting to www.drupal.org (www.drupal.org)|199.232.254.217|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://ftp.drupal.org/files/projects/drupal-9.3.3.zip [following]
--2022-01-29 03:45:24--  https://ftp.drupal.org/files/projects/drupal-9.3.3.zip
Resolving ftp.drupal.org (ftp.drupal.org)... 151.101.194.217, 151.101.130.217, 151.101.66.217, ...
Connecting to ftp.drupal.org (ftp.drupal.org)|151.101.194.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32325745 (31M) [application/zip]
Saving to: ‘zip’

zip                               100%[=============================================================>]  30.83M  72.1MB/s    in 0.4s    

2022-01-29 03:45:25 (72.1 MB/s) - ‘zip’ saved [32325745/32325745]

Step 5 : List the package by using the below command

root@linuxhelp:~# ls -la
total 45888
drwx------  5 root root     4096 Jan 29 03:45 .
drwxr-xr-x 19 root root     4096 Dec 14 18:16 ..
-rw-r--r--  1 root root     3106 Dec  5  2019 .bashrc
drwx------  3 root root     4096 Jul  3  2021 .cache
drwx------  3 root root     4096 Dec 14 18:35 .dbus
drwxr-xr-x  3 root root     4096 Dec 15 15:09 .local
-rw-------  1 root root      455 Jan 29 03:44 .mysql_history
-rw-r--r--  1 root root 14619708 Apr  2  2018 navigate-2.8r1302.zip
-rw-r--r--  1 root root      161 Dec  5  2019 .profile
-rw-r--r--  1 root root      218 Jan 29 03:45 .wget-hsts
-rw-r--r--  1 root root 32325745 Jan 19 21:27 zip

Step 6 : Extract the downloaded file by using the below command

root@linuxhelp:~# unzip zip 
Archive:  zip
   creating: drupal-9.3.3/
   creating: drupal-9.3.3/vendor/
   creating: drupal-9.3.3/vendor/composer/
   creating: drupal-9.3.3/vendor/composer/installers/
   creating: drupal-9.3.3/vendor/composer/installers/.github/
   creating: drupal-9.3.3/vendor/composer/installers/.github/workflows/
  inflating: drupal-9.3.3/vendor/composer/installers/.github/workflows/continuous-integration.yml  
  inflating: drupal-9.3.3/vendor/composer/installers/.github/workflows/lint.yml  
  inflating: drupal-9.3.3/vendor/composer/installers/.github

Step 7 : Move the Drupal CMS to the Apache2 home directory by using the below command

root@linuxhelp:~# mv drupal-9.3.3/ /var/www/drupal

Step 8 : Change the Ownership by using the below command

root@linuxhelp:~# chown -R www-data.www-data /var/www/drupal/

Step 9 : Change the permission by using the below command

root@linuxhelp:~# chmod -R 755 /var/www/drupal/

Step 10 : Enter the virtualhost in the drupalconf file

root@linuxhelp:~# nano /etc/apache2/sites-available/drupal.conf
<Virtualhost *:80>
        Servername www.linuxhelp1.com
        Documentroot /var/www/drupal
<directory /var/www/drupal>
allowoverride all
allow from all
</directory>
</Virtualhost>

Step 11 : Disable the 000-default.conf configut=ration site by using the below command

root@linuxhelp:~# a2dissite 000-default.conf
Site 000-default already disabled

Step 12 : Enable the drupal.conf file by using the below command

root@linuxhelp:~# a2ensite drupal.conf
Enabling site drupal.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 13 : Put the host Entry by using the below command

root@linuxhelp:~# nano /etc/hosts

Step 14 : Restart the apache2 web server by using the below command

root@linuxhelp:~# systemctl restart apache2

Step 15 : Open the browser and enter the host name in the search bar by seeing the below image Step 16 : Here we can see the installation page of the Drupal CMS, we will install it by using the below image Step 17 : Here we can see the Home page of Drupal CMS mentioned in the below image By this the process of Installing the Drupal CMS on Linux Mint 20.2 has come to an end…!!

FAQ
Q
Is a database is needed for installing the Drupal CMS?
A
Yes, for installing procedure Database need to give for a move to the next process.
Q
How will you extract the downloaded file?
A
To extract the downloaded file by using the unzip command.
Q
How to rewrite the module after installing it?
A
To rewrite the module after installing it using the a2enmod rewrite command.
Q
Are PHP modules are missing in the installation Drupal CMS will Install?
A
No, because that also included installing the Drupal CMS.
Q
How to download the Drupal CMS?
A
To download the Drupal CMS use wget https://www.drupal.org/download-latest/zip command.