How to install Drupal CMS on Rocky Linux 9.2
- 00:35 Cat /etc/os-release
- 00:54 php -v
- 01:11 dnf config-manager --set-enabled crb
- 01:46 dnf install epel-release -y
- 02:17 dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
- 02:50 dnf update -y
- 03:12 dnf module list php
- 03:34 dnf -y install yum-utils
- 03:55 dnf module enable php:remi-8.2 -y
- 04:23 dnf install php php-cli php-common php-fpm php-gd
- 05:15 php -v
- 05:29 dnf install httpd* -y
- 06:01 systemctl enable httpd
- 06:12 systemctl start httpd
- 06:25 systemctl status httpd
- 06:43 dnf install -y mariadb-server
- 07:19 systemctl enable mariadb
- 07:29 systemctl start mariadb
- 07:41 systemctl status mariadb
- 07:58 mysql
- 08:05 CREATE DATABASE drupal;
- 08:24 CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY '123456';
- 09:12 GRANT ALL PRIVILEGES ON drupal.* to drupal_user@'localhost';
- 09:53 FLUSH PRIVILEGES;
- 10:05 \q
- 10:13 vim /etc/php.ini
- 10:51 wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
- 11:14 tar xvf drupal.tar.gz
- 11:43 mv drupal-*/ /var/www/html/drupal
- 12:12 chown -R apache: /var/www/html/
- 12:33 chmod -R 755 /var/www/html/
- 12:52 vim /etc/httpd/conf.d/drupal.conf
- 13:34 httpd -t
- 13:50 setenforce 0
- 14:03 systemctl restart httpd
To Install Drupal CMS On Rocky Linux 9.2
Introduction:
Drupal is a free and open-source content management system (CMS) written in PHP that provides a powerful platform for building a variety of websites, from personal blogs to enterprise applications. Drupal is well-known for its flexibility, scalability, and extensibility, making it a popular choice for developers and organizations seeking a robust web content management solution.
Procedure Steps:
Step 1: Check the OS version by using the below command
[root@Linuxhelp ~]# cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.2 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.2"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.2"
Step 2: Check the current PHP version because Drupal 10 currently requires either PHP 8.1 or PHP 8.2 by using the below command
[root@Linuxhelp ~]# php -v
PHP 8.0.30 (cli) (built: Aug 3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
Step 3: Current PHP version does not meet the requirements for installing the Drupal CMS So installing PHP 8.2 version by using the below steps. Enable EPEL and REMI repositories by using the below command
[root@Linuxhelp ~]# dnf config-manager --set-enabled crb
[root@Linuxhelp ~]# dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Rocky Linux 9 - CRB 1.5 MB/s | 2.3 MB 00:01
remi-release-9.rpm 37 kB/s | 30 kB 00:00
Dependencies resolved.
==============================================================================================================================================================================================================
Install 2 Packages
Upgrade 2 Packages
Total size: 84 k
Total download size: 55 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): rocky-release-9.3-1.2.el9.noarch.rpm 137 kB/s | 23 kB 00:00
(2/3): rocky-repos-9.3-1.2.el9.noarch.rpm 73 kB/s | 13 kB 00:00
(3/3): epel-release-9-7.el9.noarch.rpm 103 kB/s | 19 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Upgraded:
rocky-release-9.3-1.2.el9.noarch rocky-repos-9.3-1.2.el9.noarch
Installed:
epel-release-9-7.el9.noarch remi-release-9.3-3.el9.remi.noarch
Complete!
Step 4: Update the server by using the below command
[root@Linuxhelp ~]# dnf update -y
Extra Packages for Enterprise Linux 9 - x86_64 98 kB/s | 20 MB 03:31
Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64 583 B/s | 2.5 kB 00:04
Remi's Modular repository for Enterprise Linux 9 - x86_64 235 kB/s | 647 kB 00:02
Safe Remi's RPM repository for Enterprise Linux 9 - x86_64 329 kB/s | 975 kB 00:02
Dependencies resolved.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 5.5 MB/s | 988 MB 02:58
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Upgraded:
php-8.2.15-1.el9.remi.x86_64 php-cli-8.2.15-1.el9.remi.x86_64 php-common-8.2.15-1.el9.remi.x86_64 php-fpm-8.2.15-1.el9.remi.x86_64 php-mbstring-8.2.15-1.el9.remi.x86_64
php-opcache-8.2.15-1.el9.remi.x86_64 php-pdo-8.2.15-1.el9.remi.x86_64 php-xml-8.2.15-1.el9.remi.x86_64
Installed:
gd3php-2.3.3-9.el9.remi.x86_64 highway-1.0.7-1.el9.x86_64 jxl-pixbuf-loader-0.7.0-1.el9.x86_64 libaom-3.8.0-1.el9.x86_64 libavif-0.11.1-4.el9.x86_64
libdav1d-1.2.1-1.el9.x86_64 libimagequant-2.17.0-1.el9.x86_64 libjxl-0.7.0-1.el9.x86_64 libraqm-0.8.0-1.el9.x86_64 libsodium-1.0.18-8.el9.x86_64
libvmaf-2.3.0-2.el9.x86_64 oniguruma5php-6.9.9-1.el9.remi.x86_64 php-gd-8.2.15-1.el9.remi.x86_64 php-sodium-8.2.15-1.el9.remi.x86_64 rav1e-libs-0.6.6-3.el9.x86_64
svt-av1-libs-0.9.0-1.el9.x86_64
Complete!
Step 5: Once done, list the available PHP streams. You can see the remi-8.2 php module by using the below command
[root@Linuxhelp ~]# dnf module list php
Last metadata expiration check: 0:37:28 ago on Wednesday 31 January 2024 08:32:41 AM.
Rocky Linux 9 - AppStream
Name Stream Profiles Summary
php 8.1 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream Profiles Summary
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
php remi-8.2 common [d], devel, minimal PHP scripting language
php remi-8.3 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
Step 6: Enable the module before installing PHP 8.2 by using the below command
[root@Linuxhelp ~]# dnf -y install yum-utils
Last metadata expiration check: 0:37:38 ago on Wednesday 31 January 2024 08:32:41 AM.
Dependencies resolved.
==============================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================
Installing:
yum-utils noarch 4.3.0-11.el9_3 baseos 36 k
Transaction Summary
==============================================================================================================================================================================================================
Install 1 Package
Total download size: 36 k
Installed size: 23 k
Downloading Packages:
yum-utils-4.3.0-11.el9_3.noarch.rpm 114 kB/s | 36 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Installed:
yum-utils-4.3.0-11.el9_3.noarch
Complete!
[root@Linuxhelp ~]# dnf module enable php:remi-8.2 -y
Last metadata expiration check: 0:37:47 ago on Wednesday 31 January 2024 08:32:41 AM.
Dependencies resolved.
==============================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================
Enabling module streams:
php remi-8.2
Transaction Summary
==============================================================================================================================================================================================================
Complete!
Step 7: Install PHP and modules by using the below command
[root@Linuxhelp ~]# dnf install php php-cli php-common php-fpm php-gd
Last metadata expiration check: 0:38:03 ago on Wednesday 31 January 2024 08:32:41 AM.
Package php-8.0.30-1.el9_2.x86_64 is already installed.
Package php-cli-8.0.30-1.el9_2.x86_64 is already installed.
Package php-common-8.0.30-1.el9_2.x86_64 is already installed.
Package php-fpm-8.0.30-1.el9_2.x86_64 is already installed.
Dependencies resolved.
==============================================================================================================================================================================================================
Install 16 Packages
Upgrade 8 Packages
Total download size: 18 M
Is this ok [y/N]: y
Downloading Packages:
(1/24): highway-1.0.7-1.el9.x86_64.rpm 48 kB/s | 33 kB 00:00
(2/24): jxl-pixbuf-loader-0.7.0-1.el9.x86_64.rpm 71 kB/s | 53 kB 00:00
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 126 kB/s | 18 MB 02:28
Extra Packages for Enterprise Linux 9 - x86_64 746 kB/s | 1.6 kB 00:00
Importing GPG key 0x3228467C:
Userid : "Fedora (epel9) <[email protected]>"
Fingerprint: FF8A D134 4597 106E CE81 3B91 8A38 72BF 3228 467C
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9
Is this ok [y/N]: y
Key imported successfully
Remi's Modular repository for Enterprise Linux 9 - x86_64 1.3 MB/s | 3.1 kB 00:00
Importing GPG key 0x478F8947:
Userid : "Remi's RPM repository (https://rpms.remirepo.net/) <[email protected]>"
Fingerprint: B1AB F71E 14C9 D748 97E1 98A8 B195 27F1 478F 8947
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el9
Is this ok [y/N]: y
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Upgraded:
php-8.2.15-1.el9.remi.x86_64 php-cli-8.2.15-1.el9.remi.x86_64 php-common-8.2.15-1.el9.remi.x86_64 php-fpm-8.2.15-1.el9.remi.x86_64 php-mbstring-8.2.15-1.el9.remi.x86_64
php-opcache-8.2.15-1.el9.remi.x86_64 php-pdo-8.2.15-1.el9.remi.x86_64 php-xml-8.2.15-1.el9.remi.x86_64
Installed:
gd3php-2.3.3-9.el9.remi.x86_64 highway-1.0.7-1.el9.x86_64 jxl-pixbuf-loader-0.7.0-1.el9.x86_64 libaom-3.8.0-1.el9.x86_64 libavif-0.11.1-4.el9.x86_64
libdav1d-1.2.1-1.el9.x86_64 libimagequant-2.17.0-1.el9.x86_64 libjxl-0.7.0-1.el9.x86_64 libraqm-0.8.0-1.el9.x86_64 libsodium-1.0.18-8.el9.x86_64
libvmaf-2.3.0-2.el9.x86_64 oniguruma5php-6.9.9-1.el9.remi.x86_64 php-gd-8.2.15-1.el9.remi.x86_64 php-sodium-8.2.15-1.el9.remi.x86_64 rav1e-libs-0.6.6-3.el9.x86_64
svt-av1-libs-0.9.0-1.el9.x86_64
Complete!
Step 8: Check the PHP version. You can see the PHP 8.2 version by using the below command
[root@Linuxhelp ~]# php -v
PHP 8.2.15 (cli) (built: Jan 16 2024 12:19:32) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.15, Copyright (c) Zend Technologies
with Zend OPcache v8.2.15, Copyright (c), by Zend Technologies
Step 9: Install the Apache web server by using the below command
[root@Linuxhelp ~]# dnf install httpd* -y
Last metadata expiration check: 1:09:21 ago on Wednesday 31 January 2024 08:32:41 AM.
Package httpd-2.4.57-5.el9.x86_64 is already installed.
Package httpd-core-2.4.57-5.el9.x86_64 is already installed.
Package httpd-filesystem-2.4.57-5.el9.noarch is already installed.
Package httpd-tools-2.4.57-5.el9.x86_64 is already installed.
Dependencies resolved.
Installed:
apr-devel-1.7.0-12.el9_3.x86_64 apr-util-devel-1.6.1-23.el9.x86_64 cyrus-sasl-2.1.27-21.el9.x86_64 cyrus-sasl-devel-2.1.27-21.el9.x86_64 expat-devel-2.5.0-1.el9.x86_64 httpd-devel-2.4.57-5.el9.x86_64
httpd-manual-2.4.57-5.el9.noarch libdb-devel-5.3.28-53.el9.x86_64 openldap-devel-2.6.3-1.el9.x86_64
Complete!
Step 10: Enable and Start the Apache service by using the below command .
[root@Linuxhelp ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@Linuxhelp ~]# systemctl start httpd
Step 11: Check the status of the apache service by using the below command.
[root@Linuxhelp ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; preset: disabled)
Drop-In: /etc/systemd/system/httpd.service.d
└─php-fpm.conf
Active: active (running) since Wed 2024-01-31 09:42:28 IST; 9s ago
Docs: man:httpd.service(8)
Main PID: 102829 (httpd)
Status: "Started, listening on: port 80"
Tasks: 213 (limit: 22877)
Memory: 37.2M
CPU: 263ms
CGroup: /system.slice/httpd.service
├─102829 /usr/sbin/httpd -DFOREGROUND
├─102837 /usr/sbin/httpd -DFOREGROUND
├─102838 /usr/sbin/httpd -DFOREGROUND
├─102839 /usr/sbin/httpd -DFOREGROUND
└─102840 /usr/sbin/httpd -DFOREGROUND
Jan 31 09:42:27 Linuxhelp systemd[1]: Starting The Apache HTTP Server...
Jan 31 09:42:28 Linuxhelp httpd[102829]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe61:4e66%ens160. Set the 'ServerName' directive globall>
Jan 31 09:42:28 Linuxhelp httpd[102829]: Server configured, listening on: port 80
Jan 31 09:42:28 Linuxhelp systemd[1]: Started The Apache HTTP Server.
Step 12: Install MariaDB server by using the below command
[root@Linuxhelp ~]# dnf install -y mariadb-server
Last metadata expiration check: 1:10:06 ago on Wednesday 31 January 2024 08:32:41 AM.
Dependencies resolved.
==============================================================================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================================================================
Installed:
mariadb-3:10.5.22-1.el9_2.x86_64 mariadb-backup-3:10.5.22-1.el9_2.x86_64 mariadb-common-3:10.5.22-1.el9_2.x86_64 mariadb-connector-c-3.2.6-1.el9_0.x86_64
mariadb-connector-c-config-3.2.6-1.el9_0.noarch mariadb-errmsg-3:10.5.22-1.el9_2.x86_64 mariadb-gssapi-server-3:10.5.22-1.el9_2.x86_64 mariadb-server-3:10.5.22-1.el9_2.x86_64
mariadb-server-utils-3:10.5.22-1.el9_2.x86_64 mysql-selinux-1.0.5-1.el9_0.noarch perl-DBD-MariaDB-1.21-16.el9_0.x86_64 perl-File-Copy-2.34-480.el9.noarch
perl-Sys-Hostname-1.23-480.el9.x86_64
Complete!
Step 13: Enable and Start the MariaDB service by using the below command .
[root@Linuxhelp ~]# systemctl enable mariadb
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.
[root@Linuxhelp ~]# systemctl start mariadb
Step 14: Check the status of the MariaDB service by using the below command.
[root@Linuxhelp ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
Active: active (running) since Wed 2024-01-31 09:46:08 IST; 27s ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Process: 104543 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS)
Process: 104565 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS)
Process: 104664 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS)
Main PID: 104648 (mariadbd)
Status: "Taking your SQL requests now..."
Tasks: 15 (limit: 22877)
Memory: 75.6M
CPU: 961ms
CGroup: /system.slice/mariadb.service
└─104648 /usr/libexec/mariadbd --basedir=/usr
Jan 31 09:46:07 Linuxhelp mariadb-prepare-db-dir[104604]: The second is mysql@localhost, it has no password either, but
Jan 31 09:46:07 Linuxhelp mariadb-prepare-db-dir[104604]: https://mariadb.org/get-involved/
Jan 31 09:46:08 Linuxhelp systemd[1]: Started MariaDB 10.5 database server.
Step 15: Create a database and user for the Drupal CMS by using the below command
[root@Linuxhelp ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.5.22-MariaDB MariaDB Server
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.001 sec)
MariaDB [(none)]> CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON drupal.* to drupal_user@'localhost';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> \q
Bye
Step 16: Increase memory size in the php.ini file by using the below command
[root@Linuxhelp ~]# vim /etc/php.ini
memory_limit = 256M
Step 17: Download the Drupal CMS package by using the below command
[root@Linuxhelp ~]# wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
--2024-01-31 10:02:31-- https://www.drupal.org/download-latest/tar.gz
Resolving www.drupal.org (www.drupal.org)... 151.101.2.217, 151.101.66.217, 151.101.130.217, ...
Connecting to www.drupal.org (www.drupal.org)|151.101.2.217|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://ftp.drupal.org/files/projects/drupal-10.2.2.tar.gz [following]
--2024-01-31 10:02:33-- https://ftp.drupal.org/files/projects/drupal-10.2.2.tar.gz
Resolving ftp.drupal.org (ftp.drupal.org)... 151.101.2.217, 151.101.66.217, 151.101.130.217, ...
Connecting to ftp.drupal.org (ftp.drupal.org)|151.101.2.217|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18950678 (18M) [application/octet-stream]
Saving to: ‘drupal.tar.gz’
drupal.tar.gz 100%[=================================================================================================================>] 18.07M 9.74MB/s in 1.9s
2024-01-31 10:02:35 (9.74 MB/s) - ‘drupal.tar.gz’ saved [18950678/18950678]
Step 18: Extract the downloaded package by using the tar command
[root@Linuxhelp ~]# tar xvf drupal.tar.gz
drupal-10.2.2/
drupal-10.2.2/vendor/
drupal-10.2.2/vendor/composer/
drupal-10.2.2/vendor/composer/semver/
drupal-10.2.2/vendor/composer/semver/CHANGELOG.md
drupal-10.2.2/vendor/composer/semver/LICENSE
drupal-10.2.2/vendor/composer/semver/README.md
drupal-10.2.2/vendor/composer/semver/composer.json
drupal-10.2.2/vendor/composer/semver/phpstan-baseline.neon
drupal-10.2.2/vendor/composer/semver/src/
drupal-10.2.2/composer.json
drupal-10.2.2/composer.lock
drupal-10.2.2/LICENSE.txt
Step 19: Move the Extracted folder to the Apache document root directory by using the below command
[root@Linuxhelp ~]# mv drupal-*/ /var/www/html/drupal
Step 20: Change the ownership and permission of the folder by using the below command
[root@Linuxhelp ~]# chown -R apache: /var/www/html/
[root@Linuxhelp ~]# chmod -R 755 /var/www/html/
Step 21: Create a virtual host file to access the Drupal CMS by using the below command
[root@Linuxhelp ~]# vim /etc/httpd/conf.d/drupal.conf
<VirtualHost *:80>
ServerName linuxhelp1.com
ServerAdmin [email protected]
DocumentRoot /var/www/html/drupal/
ErrorLog /etc/httpd/logs/error.log
CustomLog /etc/httpd/logs/access.log combined
<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>
Step 22: Check the syntax of the apache configuration file by using the below command
[root@Linuxhelp ~]# httpd -t
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe61:4e66%ens160. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Step 23: Enable site configuration by disabling the SELinux by using the below command
[root@Linuxhelp ~]# setenforce 0
Step 24: Restart the Apache service by using the below command
[root@Linuxhelp ~]# systemctl restart httpd
Go to the browser and search with your IP or domain as shown in the below image
Choose the language as shown in the above image
Select an Installation profile as shown in the above image
Set the database configuration and click the “Save and continue” option to start installation
Enter the Site Details as shown in the below image and click the “Save and continue” option
Finally you will seen the Welcome page of Drupal CMS
Conclusion
We have reached the end of this article. In this guide, we have walked you through the steps required to install Drupal CMS on Rocky Linux 9.2. Your feedback is much welcome.
Comments ( 0 )
No comments available