How to Install WordPress CMS on Ubuntu 21.04

To Install Wordpress CMS on Ubuntu 21.04

Introduction

CMS means Content management system, it is the software user to manage the digital content. WordPress is a free and open-source content management system (CMS) written in PHP

Prerequisites:

• Apache Web server

• Maria DB

• PHP and its Modules

Installation Procedure

Step 1: Check the OS version by using the below command

root@linuxhelp:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Step 2: Log in to the Maria DB by using the below command

root@linuxhelp:~# mysql -u root -p 
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 30
Server version: 10.5.12-MariaDB-0ubuntu0.21.04.1 Ubuntu 21.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Step 3:Create database for Wordpress CMS by using the below command

MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.001 sec)

Step 4: Create a user and Grant all privileges on wordpress database for the user “wordpress” by using the below command

MariaDB [(none)]> grant all on wordpress.* to wordpress@localhost identified by 'linuxc';
Query OK, 0 rows affected (0.004 sec)

Step 5: Flush privileges to make changes effect by using the below command

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)

Step 6: Exit from the Maria DB

MariaDB [(none)]> exit
Bye

Step 7: Download wordpress CMS by using the below command

root@linuxhelp:~# wget https://wordpress.org/latest.tar.gz
--2021-12-06 01:23:34--  https://wordpress.org/latest.tar.gz
Resolving wordpress.org (wordpress.org)... 198.143.164.252
Connecting to wordpress.org (wordpress.org)|198.143.164.252|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15085301 (14M) [application/octet-stream]
Saving to: ‘latest.tar.gz’

latest.tar.gz               100%[========================================>]  14.39M  2.38MB/s    in 17s     

2021-12-06 01:23:51 (882 KB/s) - ‘latest.tar.gz’ saved [15085301/15085301]

Step 8: Extract the downloaded file by using the below command

root@linuxhelp:~# tar xzvf latest.tar.gz
wordpress/
wordpress/xmlrpc.php
wordpress/wp-blog-header.php
wordpress/readme.html
wordpress/wp-signup.php
wordpress/index.php
wordpress/wp-content/
wordpress/wp-content/themes/
wordpress/wp-admin/js/code-editor.min.js
wordpress/wp-admin/js/set-post-thumbnail.js
wordpress/wp-admin/options-permalink.php
wordpress/wp-admin/widgets.php
wordpress/wp-admin/setup-config.php
wordpress/wp-admin/install.php
wordpress/wp-admin/admin-header.php
wordpress/wp-admin/post-new.php
wordpress/wp-admin/themes.php
wordpress/wp-admin/options-reading.php
wordpress/wp-trackback.php
wordpress/wp-comments-post.php

Step 9: Move the extracted directory to the apache home directory by using the below command

root@linuxhelp:~# mv wordpress/  /var/www/

Step 10: Change ownership for the wordpress directory by using the below command

root@linuxhelp:~# chown -R www-data. /var/www/wordpress

Step 11: Change Permission to the Wordpress directory by using the below command

root@linuxhelp:~# chmod -R 775 /var/www/wordpress

Step 12: Create Virtual Host for the wordpress CMS by using the below command

root@linuxhelp:~# vi /etc/apache2/sites-available/wordpress.conf

<virtualhost *:80>
servername www.linuxhelp1.com
documentroot /var/www/ wordpress

<Directory /var/www/ wordpress >

        AllowOverride All
        allow from all 
</Directory>
</virtualhost>

Step 13: Enable the Virtual Host by using the below command

root@linuxhelp:~# a2ensite wordpress.conf
Enabling site wordpress.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 14: Disable the default Virtual Host file of apache by using the below command

root@linuxhelp:~# a2dissite 000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 15: Enable the read write module of apache by using the below command

root@linuxhelp:~# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
  systemctl restart apache2

Step 16: Restart the apache webserver by using the below command

root@linuxhelp:~# systemctl restart apache2

Step 17:Make host entry for wordpress CMS by using the below command

root@linuxhelp:~# vi /etc/hosts

192.168.6.115 www.linuxhelp1.com

Step 18: Ping server name in browser as show in the below image

Step 19: Give Data Base Credentials as shown in the below image

Step 20: Create Admin Credentials as shown in the below image

Step 21: Login to the Admin section as shown in the below image

Step 22: This is the Wordpress CMS Dashboard

By this the process of installing Wordpress CMS on Ubuntu 21.04 has been completed

FAQ
Q
What is the latest version of WordPress CMS?
A
The latest version of WordPress CMS is 5.8.2
Q
From what WordPress is written?
A
WordPress is written in PHP
Q
Is WordPress is open-source?
A
Yes, WordPress is a free and open-source content management system.
Q
What are the dependencies for WordPress CMS?
A
The dependencies for WordPress CMS are
1) 7.4 or greater of PHP
2) MySQL version 5.6 OR MariaDB version 10.1 or greater
3) Apache or Nginx.
Q
How can we download WordPress CMS?
A
Word press CMS can be downloaded by "wget https://wordpress.org/latest.tar.gz" command.