We're here to assist with any of your needs, don't hestitate to reach out.
Drupal is a free and open-source content management system (CMS) used for building websites and applications. It provides a flexible platform that allows users to easily manage and publish content, create customizable layouts, and add various functionalities through extensions and modules.
In this tutorial, we will guide you through the process of installing Drupal on CentOS 8.
First, log in to your CentOS 8 server via SSH as the root user.
Change to the Apache document root directory:
cd /var/www/html
Download the latest stable version of Drupal using the following wget command:
wget https://www.drupal.org/download-latest/tar.gz
Extract the downloaded file:
tar -xvzf tar.gz
Move the extracted Drupal directory to a more appropriate location:
mv drupal-* /var/www/html/drupal
Open the Apache default virtual host configuration file using a text editor:
vi /etc/httpd/conf.d/virtualhost.conf
Add the following configuration to the file:
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/html/drupal
Options FollowSymLinks
AllowOverride All
ErrorLog /var/log/httpd/example.com_error.log
CustomLog /var/log/httpd/example.com_access.log combined
Save and exit the file.
Log in to the MySQL shell:
mysql -u root -p
Create a new database for Drupal:
CREATE DATABASE drupaldb;
Create a new database user and grant all privileges on the database:
CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON drupaldb.* TO 'drupaluser'@'localhost';
FLUSH PRIVILEGES;
Exit the MySQL shell:
EXIT;
Open your web browser and visit the following URL:
http://example.com/install.php
Replace "example.com" with your domain name or server IP.
Follow the on-screen instructions to complete the Drupal installation process. You will need to provide the database name, database user, and password that you created in Step 3.
After the installation is complete, remove the installation directory for security purposes:
rm -rf /var/www/html/drupal/install.php
Edit the Drupal configuration file:
vi /var/www/html/drupal/sites/default/settings.php
Locate the line that contains $settings['trusted_host_patterns']
and add your domain or IP address:
$settings['trusted_host_patterns'] = [
'^www\.example\.com$',
];
Save and exit the file.
Disable the Apache directory listings:
vi /etc/httpd/conf.d/welcome.conf
Add a #
in front of the following line to comment it out:
# Options -Indexes
Save and exit the file.
Restart the Apache service for the changes to take effect:
systemctl restart httpd
Congratulations! You have successfully installed Drupal on CentOS 8.
Now you can access your Drupal site by visiting your domain or server IP in your web browser.
What our customers say about us
Create your free account today.