CMS platforms are becoming a norm in the World Wide Web and Drupal is a reputable candidate in this docket. With CMS platforms, content management is easier for all users as all the needed administrative functionalities for managing website content have been met. Therefore, it doesn’t matter whether you are running a small blog site, government site, or a large corporate website.
Drupal is powered by PHP programming language and this article guide will walk us through its installation on Ubuntu 20.04 and Ubuntu 22.04.
Drupal Features
The following are the prominent features of Drupal.
- It is free and open-source.
- 30000-plus freely available and downloadable modules.
- Default-installed support for creating polls, forums, and blogs via modules.
- 110-plus languages support.
- Multi-user content editing and multi-site support.
- Basic features support for creating a comment system, pages, add-ons, RSS feeds, publishing posts, etc.
Prerequisites
Ensure that you are a Sudoer/root user on the Ubuntu system you are using and have a basic understanding of using the Linux terminal/command-line interface.
Installing Apache and PHP in Ubuntu
First, make sure that the Ubuntu system you are using is up-to-date.
$ sudo apt update -y $ sudo apt upgrade -y
Next, install Apache web server and PHP using the following command.
$ sudo apt install apache2 php libapache2-mod-php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-intl php-mbstring php-curl php-xml php-pear php-tidy php-soap php-bcmath php-xmlrpc
Installing MySQL in Ubuntu
The next step is to have MySQL or MariaDB database installed and configured on your Ubuntu system.
To install MySQL run:
$ sudo apt install mysql-server
To install MariaDB run:
$ sudo apt install mariadb-server mariadb-client
After either of the above installations is complete, secure your installed database with the command:
$ sudo mysql_secure_installation
Since Ubuntu systems use Unix_auth_socket_plugin for MySQL/MariaDB, accessing this database might require Sudoer privileges:
$ sudo mysql -u root -p
Create a Drupal user, database, and grant this user the needed database privileges.
MariaDB [(none)]> CREATE USER drupal@localhost IDENTIFIED BY "Your_drupal_user_password"; MariaDB [(none)]> CREATE DATABASE drupal; MariaDB [(none)]> GRANT ALL ON drupal.* TO drupal@localhost; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Installing Drupal in Ubuntu
The official Ubuntu repository does not have Drupal as a package. Therefore, downloading Drupal from its website via the wget command ensures we get its latest version release.
$ wget https://www.drupal.org/download-latest/tar.gz -O drupal.tar.gz
Extract drupal and move it to /var/www/html directory and set the appropriate permissions.
$ tar -xvf drupal.tar.gz $ sudo mv drupal-9.3.7 /var/www/html/drupal $ sudo chown -R www-data:www-data /var/www/html/drupal/ $ sudo chmod -R 755 /var/www/html/drupal/
Create Drupal Apache Virtual Host in Ubuntu
Create a virtual host file for Drupal and implement a similar configuration to the one below.
$ sudo nano /etc/apache2/sites-available/drupal.conf
Add the following virtual host configuration.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/drupal/ ServerName linuxshelltips.lan.network ServerAlias www.linuxshelltips.lan.network ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html/drupal/> Options FollowSymLinks AllowOverride All Require all granted </Directory> <Directory /var/www/html/> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [LxQSA] </Directory> </VirtualHost>
Next, enable the mod_rewrite rule.
$ sudo a2ensite drupal.conf $ sudo a2enmod rewrite
Restart Apache web server and make sure it is running:
$ sudo systemctl restart apache2 $ sudo systemctl status apache2
Installing Drupal from Web Browser
The final setup of Drupal will be through your web browser based on the domain name you specified in drupal.conf file.
http://linuxshelltips.lan.network
Choose a preferred language.
Choose the installation standard profile.
Fill in your database details.
The above step might take some time to complete, therefore, be patient. Afterward, drupal site installation will automatically begin.
This step will also take some time before completing. The final step will be to fill in your site’s details like site name, and email address.
You should then be greeted with the following screen capture:
From here, you can explore and manage your web content through this extensive Drupal CMS.
With Drupal, you do not just have any CMS. You have an extensive and scalable platform for managing both users and web content you hope to create in a flexible and memorable user interface.