Drupal is a free and open-source content management system (CMS), is flexible for building blogs and websites. It is written in PHP programming language and uses MySQL as a backend database. Drupal is available with thousands of add-ons, which makes it highly customizable.
You can deploy Drupal on any web server that supports the PHP programming language. In this tutorial, we will provide you with steps to install Drupal with Apache on Fedora Linux systems.
Prerequisites
This tutorial assumes that:
- You have a running Fedora system with sudo privileged account access
- Already completed the LAMP Stack on Fedora system.
Step 1 – Installing Drupal on Fedora
1. You can download the latest Drupal version from the Drupal website. Alternatively, download the latest Drupal code using the following command:
wget -O /tmp/drupal.tar.gz https://www.drupal.org/download-latest/tar.gz
2. Go to the ‘/var/www/’ folder and extract the downloaded durpal.tar.gz file. You can also change the directory to another location. In that case, use the correct folder in the next commands.
cd /var/www
sudo tar -zxf /tmp/drupal.tar.gz
3. Rename the extracted drupal directory to remove the version number. If required, you can keep the folder name as it is.
sudo mv drupal-* drupal-app
4. Next create a copy of configuration file from template. Change to “drupal-app/sites/default” directory and copy the default.settings.php file to settings.php with cp command:
cd drupal-app/sites/default
sudo cp -p default.settings.php settings.php
5. Now, Create a directory named "files"
in the current directory drupal-app/sites/default:
sudo mkdir files
6. Now set the proper file permissions to make it work. Initially set 777 permission to settings.php, which is required to complete installation.
sudo chmod 777 settings.php
sudo chmod 775 files/
sudo chown -R www-data:www-data /var/www/drupal-app
Next, configure the Apache server to deploy the Drupal site.
Step 2 – Setup Apache
Create a Virtual Host configuration file for the Drupal installation. In order to secure your site with an SSL certificate, we recommend using a real domain pointed to your server’s IP address.
Let’s create a Apache configuration file for your domain. Make sure to change domain name with yours:
sudo vim /etc/httpd/conf.d/drupal.example.net.conf
Add the following content.
1 2 3 4 5 6 7 8 | <VirtualHost *:80> ServerAdmin admin@example.net ServerName drupal.example.net DocumentRoot /var/www/drupal-app <Directory /var/www/drupal-app> Allowoverride all </Directory> </VirtualHost> |
Change the ServerName value with your domain name.
Save and close the configuration file. Then restart the Apache service to reload the configuration file.
sudo systemctl restart httpd
Step 3 – Running Web Installer
Open your favorite web browser and access the Drupal website as configured in Apache. As per this tutorial, we have configured the website as below URL:
http(s)://drupal.example.net
Follow the on-screen instructions to complete the Drupal installation on the Fedora Linux system.
1. Choose the default language for your Drupal application.
2. Then select the type of installation for Drupal. Here you have 3 options to choose from. We recommended going with the default “Standard” installation.
3. Now enter the database details to configure with Drupal. We are using MySQL/MariaDB as the database server. If you are not seeing the MySQL option, make sure you have the PHP MySQL extension installed.
You can also go with the SQLite database for small sites. But if you are planning a large site, we prefer to with MySQL.
4. Please wait for the installation to complete. This will install all default extensions, themes to this Drupal application.
5. Once the above installation finished, it will prompt you to enter application details for your Drupal. Fill in all the details properly.
Also, create an administrator account for Drupal. I recommended not to use username “admin”, keep it something else as I did “dradmin”. Keep your administrator password strong.
6. Once you completed all the steps successfully, you will be redirected to the Drupal admin dashboard. Write down your admin credentials at a secure place, which will be required for subsequent logins.
Now customize your entire Drupal site and add the content. Here a new beautiful website journey has been started.
Step 4 – Post Installation
The Drupal installation on your Fedora system has been finished successfully. Now secure the drupal application files with proper file permissions.
cd /var/www/drupal-app
sudo find . -type d -exec chmod 750 '{}' \;
sudo find . -type f -exec chmod 640 '{}' \;
sudo find sites/default/files/ -type d -exec chmod 770 '{}' \;
sudo find sites/default/files/ -type f -exec chmod 660 '{}' \;
sudo chmod 440 /var/www/drupal-app/sites/default/settings.php
Also, remove the downloaded archive file from your system.
rm /tmp/drupal.tar.gz
Conclusion
This tutorial helped you with installing Drupal on the Fedora Linux system.