What We Will Cover?
In this guide, we will see how to install and configure Drupal 8 on the Fedora 25 OS. We will install Drupal with Apache web server and MariaDB database server. Let us get started with the installation process of Drupal on the Fedora 25 workstation.
- Fedora 25 OS installed on your system
- Internet connectivity to download various files
- Administrative (sudo access) account on the system
Installing the Required Packages:
Step 1. To make Drupal installation easier, Fedora offers a collection of pre-packaged applications. Just use the below command to install all these packages:
$ sudo dnf install @“Web Server” drupal8 drupal8-httpd php-opcache php-mysqlnd mariadb-server
In this example, we have assumed that the web and database servers are both running on the same machine.
Step 2. The apache web service and mariadb database service can be enabled to start at boot with the command:
$ sudo systemctl enable httpd.service mariadb.service
Step 3. Start the above services using:
$ sudo systemctl start httpd.service mariadb.service
Configuring the MariaDB Database Server
Step 1. The default setup of MariaDB requires running the mysql_secure_installation script for securing the database.
$ sudo mysql_secure_installation
Now, it will ask some questions regarding setting up MariaDB. We have used the following settings here. You can choose differently as per your needs.
Enter current password for root (enter for none): [PRESS ENTER]
Set root password? [Y/n] y
New Password [Set any strong Password for MariaDB]
Re-Enter new password [Repeat the above password]
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Step 2. Login to MariaDB and create a database and a unique privileged user for this database.
1. Use the below command to create a database named “testdb”:
2. Create a user named “testuser” with a password “linuxhint313” with the command:
create user ‘testuser’@‘localhost’ identified by ‘linuxhint313’;
3. Grant the required permissions to the ‘testuser’ with the command:
grant all privileges on testdb.* to ‘testuser’@‘localhost’ identified by “linuxhint313”;
4. Reload the grant tables in the MariaDB database:
5. Exit the MariaDB database:
Configuring the Apache Web Server
Step 1. For the web server to perform some necessary operations, SELinux parameters need to be set as:
$ sudo setsebool -P httpd_can_sendmail on
Step 2. Configure Firewall to allow traffic on port 80 (HTTP):
$ sudo firewall-cmd –reload
Step 3. Next, use the cp command to copy the default.settings.php file to settings.php in the same location:
Step 4. Now set the permissions of the settings.php to 666. It will now be readable and writable by everyone.
$ sudo chmod 666 /etc/drupal8/sites/default/settings.php
Note: After the Drupal installation is complete, we need to revert the permission of settings.php to 644.
Step 5. The last step is to restart the webserver:
$ sudo systemctl restart httpd
Configuring the Drupal Installation
We are all set to configure the drupal from the web browser. Open a web browser and browse to your system’s IP address along with the /drupal8 or http://localhost/drupal8.
i) When you visit this page for the first time, it will bring up the configuration wizard for Drupal. Choose the language of your choice, then save and continue.
ii) Next, select an installation profile from the two options. Usually, a Standard profile is commonly used as it has pre-configured features. In contrast, minimal profile is normally used for building a custom site and is only recommended for advanced users.
iii) The next window will verify various requirements for configuring Drupal. If you see any dependencies or missing requirements, you can install it, then press save and continue.
iv) In the database configuration, select the radio button corresponding to MariaDB. Enter the name for your database and the username for this database. In the database password column, enter the database password you used at the time of creating the database.
If everything goes right, then the installation process should now start.
After the installation is finished, we need to revert the permission of the file settings.php to 644 so that the group members and other users of the system will only have read access. To accomplish this, run the below command:
$ sudo chmod 644 /etc/drupal8/sites/default/settings.php
Finish the installation process on the browser side by adding various site information:
Site Name – YOUR SITE NAME
Site email address – YOUR SITE EMAIL ID
Username – USERNAME FOR THE SITE
Password – PASSWORD FOR ACCESSING THIS SITE
User’s Email address – YOUR PERSONAL EMAIL ID
Default country – COUNTRY YOU BELONG TO
Default time zone – TIMEZONE
On the next screen, you will see the Homepage for your Drupal account as shown below. The email is an error in red because we have used a dummy mail ID to demonstrate this guide.
Congratulations, we have successfully installed Drupal on Fedora 25 workstation from the official software packages. The important thing to understand is we have previously performed this guide on Fedora 30 and 33 OS with no success. There is no right and latest official documentation available for installing Drupal on Fedora. It appears that Fedora’s support is not much active for Drupal in its latest releases. Hopefully, in the future, Fedora may provide support for installing Drupal on its latest updates.