Hostwinds Tutorials
Search results for:
Table of Contents
Tags: Cloud Servers, Drupal, VPS
Drupal is an established and highly regarded CSM (Content Management System) offering flexibility and ease of use when managing websites. Drupal provides excellent performance and security for larger-scale systems and has found use by the United States government, Emmy Awards, and NASA.
Drupal comes with a steep learning curve, but it provides many advantages outside of creating simple blogs. These additional advantages include higher customizability, scalability for larger platforms without loss of performance, and community-driven (Open Source) support.
Drupal most commonly requires a LAMP stack (Linux, Apache, MySQL, PHP) to run efficiently and install any operating system that offers PHP and an assignable database.
Before installing Drupal, you will need to set up the foundational requirements for it to work correctly. Firstly you will need to log in to your server via SSH and prepare your server.
Step 1: Update your OS by running the command below.
yum update
Step 1: Install Apache as the webserver. Enter "Y" for yes when prompted.
yum install httpd
Step 2: Enable Apache
systemctl enable httpd
Step 3: Set Apache to start upon booting
systemctl start httpd
Step 4: Check the status of Apache (httpd)
systemctl status httpd
Step 5: Once Apache installs and verifies, verify that it is working correctly by navigating to your server's IP in the URL. An HTTP Server Test Page should now appear.
Step 1: Begin preparing your database for drupal by installing MySQL.
yum -y install @mysql
Step 2: Enable MySQL by entering the command below.
systemctl enable --now mysqld
Step 3: Set mySQL to boot upon server start-up.
systemctl start mysqld
Step 4: Verify MySQL is active.
systemctl status mysqld
Step 5: Secure your MySQL.
mysql_secure_installation
When prompted for your MySQL password, choose a password strength between 0 and 2. Next, enter your password according to the strength you require. Hostwinds always recommends using a strong password to keep your systems safe. Once you have set up your password, proceed with replying YES to the following questions:
Step 6: Log in to your installed MySQL.
mysql -u root -p
Step 7: Create a database for your Drupal installation along with a user with privileges. Note, we are using "drupaluser" and "password" as the Drupal database username and password. Subsequently, you can interchange these with your requirements.
Note: Running the MySQL commands, "drupal_db" will be the drupal database, "drupaluser" will be the drupal database username, and "password" will be the password for the database when needed during your Drupal set-up within the Drupal GUI.
CREATE DATABASE drupal_db;
CREATE USER drupaluser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'drupaluser'@'localhost';
FLUSH PRIVILEGES;
Step 1: Drupal requires PHP and needs set-up before officially installing the CRM. Begin by running the following and answer "Y" for yes when prompted.
yum install php
Step 2: Install further PHP extensions and applications. Answer "Y" for yes when prompted
yum install php-pear php-mysqlnd php-curl php-mbstring php-gd php-xml php-pear php-fpm php-pdo php-opcache php-json php-zip php-cli
Step 3: Enable PHP
systemctl enable php-fpm
Step 4: Ensure PHP starts upon booting
systemctl start php-fpm
Download and Install Drupal Version
Step 1: Review Drupal's download page https://www.drupal.org/download and the versions available. Replace your required version with the version toward the end of the following command. We are installing version 8.8.5 in this example.
wget https://ftp.drupal.org/files/projects/drupal-8.8.5.tar.gz
Step 2: Extract your drupal download.
tar -xvf drupal-8.8.5.tar.gz
Step 3: Move the extracted folder to the Apache document root directory
mv drupal-8.8.5 /var/www/html/drupal
Step 4: Allow Apache access to access the uncompressed Drupal root directory by modifying the permissions
chown -R apache:apache /var/www/html/drupal
Step 1: Configure your Drupal settings. You can do so by access the default folder.
cd /var/www/html/drupal/sites/default
Step 2: Copy the default settings into a settings file
cp -p default.settings.php settings.php
You can now access the settings.php file to configure any of your Drupal settings further.
To access the Drupal GUI, you will need to create a configuration file in Apache to tell your web server where to look and access the required folder and files.
Step 1: Run nano on the following file to enter text editor mode.
nano /etc/httpd/conf.d/drupal.conf
Step 2: Add the following standard Apache configuration text. Please note that you need to manually change the "domainexample.com" within the ServerAdmin and ServerName column to your domain. To make these easier to see, we have made them bold.
<VirtualHost *:80>
ServerAdmin webmaster@domainexample.com
ServerName domainexample.com
DocumentRoot /var/www/html/drupal
<Directory /var/www/html/drupal/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/drupal_error.log
CustomLog /var/log/httpd/drupal_access.log combined
</VirtualHost>
Step 3: Restart your Apache Web server to finalize this.
systemctl restart httpd
Entering your server's IP in a web browser's URL should now prompt for Drupal's installation wizard.
Step 1: Choose the language you want to use.
Step 2: Choose the installation profile type you wish to install for your profile. Note that the standard installation profile starts selected by default.
Step 3: Enter the database name and password you created during the installation of MySQL to attach your Drupal. Note, in our example, our database name is drupal_db, our database user is "drupaluser," and our password is "password."
Step 4: Once the database is entered and verified, Drupal will begin its official installation.
Step 5: Lastly, you will configure your site information under configuring your site. Enter in the required details, create a username for your Drupal CRM, and password. When ready, save and continue.
Congratulations! You've now set up Drupal on your server, and you can start building your website with the Drupal user guide here.
Written by Hostwinds Team / August 9, 2021