Introduction
Drupal is an open-source content management system (CMS) that is widely used for creating websites and web applications. In this guide, we will show you how to install Drupal CMS with Apache web server and configure Free Let’s Encrypt SSL on a Windows VPS.
Prerequisites
Before proceeding with the installation, ensure that you have the following prerequisites:
- A Windows VPS with administrative privileges.
- Windows Server 2016 or later, or Windows 10/11.
- Internet connection to download the necessary packages.
- Basic knowledge of using PowerShell or Command Prompt.
Step 1: Install Apache Web Server
To run Drupal CMS, you need to install Apache on your system. Follow these steps:
- Download the Apache HTTP server from the official website: Apache HTTP Server Downloads.
- Run the installer and follow the instructions to install Apache on your Windows VPS.
- After installation, open Command Prompt as Administrator and start the Apache service using the following command:
httpd -k start
- To ensure Apache is working, open a web browser and navigate to
http://localhost
. You should see the Apache test page.
Step 2: Install PHP
Drupal CMS requires PHP. Install PHP by following these steps:
- Download PHP for Windows from the official website: PHP for Windows.
- Extract the downloaded PHP archive to a directory, e.g.,
C:\php
. - Edit the Apache configuration file (
httpd.conf
) to add PHP support. Open the file in a text editor and add the following lines:# PHP module configuration LoadModule php_module "C:/php/php7apache2_4.dll" AddHandler application/x-httpd-php .php PHPIniDir "C:/php"
- Restart Apache by running the following command in Command Prompt:
httpd -k restart
Step 3: Install MySQL or MariaDB
Drupal requires a database to store content and configuration. You can use MySQL or MariaDB. Follow these steps:
- Download MySQL from the official website: MySQL Downloads.
- Run the installer and follow the instructions to install MySQL on your Windows VPS.
- After installation, start the MySQL service and set a root password.
- Alternatively, you can install MariaDB, which is a drop-in replacement for MySQL: MariaDB Downloads.
Step 4: Download and Install Drupal CMS
Now, you can download and install Drupal CMS on your system:
- Download the latest version of Drupal from the official website: Drupal Downloads.
- Extract the downloaded Drupal archive to the web root directory, usually
C:\Apache24\htdocs\
. - Rename the extracted folder to
drupal
.
Step 5: Configure Apache Virtual Host
You need to configure Apache to serve Drupal. Edit the Apache configuration file (httpd.conf
) and add a VirtualHost entry:
DocumentRoot "C:/Apache24/htdocs/drupal" ServerName yourdomain.com DirectoryIndex index.php <Directory "C:/Apache24/htdocs/drupal"> AllowOverride All Require all granted
Save the changes and restart Apache:
httpd -k restart
Step 6: Configure the Database for Drupal
Next, create a MySQL database for Drupal:
- Log in to MySQL:
mysql -u root -p
- Create a new database for Drupal:
CREATE DATABASE drupal_db;
- Create a new user and grant permissions:
CREATE USER 'drupal_user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON drupal_db.* TO 'drupal_user'@'localhost';
Step 7: Install Let’s Encrypt SSL Certificate
To secure your site, you can use a free SSL certificate from Let’s Encrypt. Follow these steps:
- Download and install win-acme, a Let’s Encrypt client for Windows.
- Run the following command in PowerShell:
.\wacs.exe --target manual --host yourdomain.com --store pemfiles --validation http-01
- Follow the instructions to generate and install the SSL certificate.
- Configure Apache to use the SSL certificate by editing the
httpd-ssl.conf
file and adding the following lines:SSLEngine on SSLCertificateFile "C:/path/to/certificate.crt" SSLCertificateKeyFile "C:/path/to/private.key"
- Restart Apache:
httpd -k restart
Step 8: Complete the Drupal Installation
Now, open your browser and navigate to https://yourdomain.com
to complete the Drupal installation:
- Follow the on-screen instructions to set up Drupal.
- Choose your language and configure the database connection (use the database, username, and password you created earlier).
- Complete the installation and configure your site settings.
Conclusion
Congratulations! You have successfully installed Drupal CMS with Apache and a free Let’s Encrypt SSL certificate on your Windows VPS. You can now start building your website or web application with Drupal’s powerful features.