Drupal is an open-source content management system (CMS) that helps you build everything from simple websites to complex applications. It’s well-known for its flexibility, scalability, and ability to create various types of websites, including blogs, e-commerce platforms, intranets, and more.
More Information About Drupal
Drupal’s powerful framework allows for:
- Content management: Manage and structure content, user roles, and permissions easily.
- E-commerce: With Drupal Commerce, you can set up full-featured online stores.
- Multi-language support: Drupal provides seamless language translation, making it ideal for global websites.
- Security: Known for its robust security features, it’s used by governments, large corporations, and nonprofits worldwide.
- Custom themes and modules: Highly customizable to suit any design or functionality requirements.
Drupal is an excellent choice for websites requiring flexibility, complex content structures, and strong security.
Step 1: Create an Instance on Cloud.shape.host
Step 1.1: Access the Dashboard
- Log in to Cloud.shape.host.
- Click Create, then select Instances.
Step 1.2: Choose a Datacenter Location
Select a location closest to your audience, such as New York or London.
Step 1.3: Choose a Plan
Pick a plan that fits your Drupal needs, such as Standard or CPU-Optimized.
Step 1.4: Select an Operating System
Choose AlmaLinux 9 as your OS.
Step 1.5: Configure and Launch
Set your network and authentication settings, then click Create Instance.
Step 1.6: Locate your Instance’s IP
Step1.7: Connect to Your AlmaLinux Instance
Once your instance is created on Cloud.shape.host, follow the steps below to connect:
1. For Linux/macOS:
Open a terminal and use SSH to connect:
ssh root@<your-instance-ip>
Replace <your-instance-ip>
with the public IP of your AlmaLinux instance.
2. For Windows:
Download and install PuTTY, then:
- Enter your instance IP in the Host Name field.
- Click Open to initiate the connection.
Once connected, you’ll have terminal access to manage your AlmaLinux instance.
Step 2: Update the System
Update your system packages to ensure they are up to date:
dnf update
This updates the software repository index and upgrades all packages installed on your server.
Step 3: Install Apache, PHP, and MariaDB
First, add the necessary repositories for PHP and install the LAMP stack (Linux, Apache, MariaDB, PHP):
dnf install epel-release dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Reset the default PHP module and enable PHP 8.3:
dnf module reset php
dnf module enable php:remi-8.3
Next, install Apache, MariaDB, and PHP along with required PHP modules for Drupal:
dnf install httpd mariadb-server php php-cli php-devel php-mbstring php-gd php-xml php-curl php-mysqlnd php-pdo php-json php-opcache php-pear php-pecl-apcu php-pecl-crypto
Step 4: Start and Enable Apache and MariaDB
Start and enable Apache and MariaDB services to automatically run on system boot:
systemctl start httpd
systemctl enable httpd
systemctl start mariadb
systemctl enable mariadb
This ensures that both the web server and database server are running and will start on boot.
Step 5: Configure the Firewall
Open the firewall for HTTP and HTTPS traffic:
systemctl unmask firewalld
systemctl start firewalld
firewall-cmd --add-service={http,https} --permanent
firewall-cmd --reload
firewall-cmd --list-all
This allows your server to accept web traffic on ports 80 (HTTP) and 443 (HTTPS).
Step 6: Configure PHP
Edit the PHP configuration file to set the memory limit and other necessary options:
nano /etc/php.ini
Modify the following values:
memory_limit = 512M
upload_max_filesize = 60M
max_execution_time = 300
date.timezone = Europe/Stockholm
To add file upload tracking, install the uploadprogress
module:
pecl install uploadprogress
Then, create a configuration file for the module:
cat <<EOF | sudo tee /etc/php.d/uploadprogress.ini
; configuration for php uploadprogress module
; priority 15
extension=uploadprogress.so
EOF
Restart Apache to apply the changes:
systemctl restart httpd
php -m | grep uploadprogress
Step 7: Secure MariaDB and Create Database
Secure the MariaDB installation:
mariadb-secure-installation
Log in to MariaDB and create a database for Drupal:
mariadb -u root -p
Run the following SQL commands:
CREATE DATABASE drupaldb;
CREATE USER 'drupal'@'localhost' IDENTIFIED BY 'p4ssword';
GRANT ALL PRIVILEGES ON drupaldb.* TO 'drupal'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'drupal'@'localhost';
This creates a database, a user, and grants them the necessary permissions.
Step 8: Download and Install Drupal
Navigate to the /var/www/
directory and download Drupal:
cd /var/www/
wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
tar -xvf drupal.tar.gz
mv drupal-* drupal
chown -R apache:apache /var/www/drupal/
chmod -R 755 /var/www/drupal/
This downloads the latest version of Drupal and sets the correct permissions for Apache.
Step 9: Configure Apache Virtual Host for Drupal
Create a new virtual host configuration file for Drupal:
nano /etc/httpd/conf.d/drupal.conf
Insert the following configuration, replacing example.com
with your domain:
<VirtualHost *:80>
ServerName example.com
ServerAdmin admin@example.com
DocumentRoot /var/www/drupal
ErrorLog /var/log/httpd/example.com.error.log
CustomLog /var/log/httpd/example.com.access.log combined
<Directory /var/www/drupal>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/drupal/>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>
</VirtualHost>
Save and close the file, then test the Apache configuration:
apachectl configtest
systemctl restart httpd
Step 10: Install SSL and Enable HTTPS
Install Certbot and the Apache plugin to secure your site with an SSL certificate:
dnf install certbot python3-certbot-apache
certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email contact@shape.host -d almalinux.shape.host
This installs an SSL certificate and forces all traffic to use HTTPS.
Step 11: Access Drupal via Browser
Open your browser and navigate to:
https://almalinux.shape.host
Follow the Drupal setup wizard to complete the installation.
For the installation profile, select Standard if you’re first time installing Drupal, then click Save and continue.
After the system check is complete, you will see the database configuration for Drupal. Input details of your MariaDB database information, click Save and continue again.
Once the installation is complete, input details of your Drupal site information and create a new admin user for Drupal. Then, click Save and continue to confirm.
When the configuration is finished, you will get the Drupal homepage like the following:
You have successfully installed Drupal on AlmaLinux 9. With its robust content management capabilities and scalability, Drupal is ideal for websites of all sizes. For reliable hosting and performance, consider using Shape.Host’s Cloud VPS to host your Drupal instance effectively.