How to install Joomla CMS

Share

Joomla CMS

Joomla is one of the mostly used free and open-source Content Management System (CMS), it allows you to publish web components and create dynamic websites, its written in PHP and you can use MySQL or MariaDB  database management systems with joomla, in this blog we will see how to install and configure joomla on your machine.

Steps to install and configure Joomla

Step-1: Install all the dependencies to configure Joomla

To configure Joomla CMS you need to have apache web server, php and  MariaDB, install them on your machine using below commands

on your terminal use following command to install httpd and mariadb.

yum install httpd httpd-tools mariadb-server -y

then to start and enable the installed services execute following command.

systemctl enable --now httpd mariadb

Check status of services using below commands

systemctl status httpd
systemctl status mariadb

 

Install PHP

To install latest version of PHP enable Extra Package for Enterprise Linux(epel) and remi repositories.

sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo yum install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

EPEL provides a set of additional packages for RHEL which is not added in official packages, and Remi’s repository contains packages of latest version of PHP.

To find current enabled version of php use below command

sudo yum module list php

output:

From the above output, by default only  PHP 7.2 from the AppStream repo will be installed and there are no other versions enabled, to install PHP 8.1 from the remi repo enable it before installation

use below commands to enable PHP 8.1 and install it with its extensions.

sudo yum module enable php:remi-8.1
sudo yum install php php-opcache php-gd php-curl php-mysqlnd php-mbstring php-xml php-pear php-fpm php-mysql php-pdo php-json php-zip php-common php-cli php-xmlrpc php-xml php-tidy php-soap php-bcmath php-devel

after successful installation use below command to start and enable php-fpm service.

systemctl enable --now php-fpm

then execute the following command to check the status of php-fpm.

systemctl status php-fpm

Step-2: Create a database for Joomla

use below command to login into your mariadb shell.

mysql -u root -p

using below given commands create a database, database user and grant permissions for
the created user.

MariaDB [(none)]>CREATE DATABASE joomla_database;
MariaDB [(none)]>CREATE USER aksshaay@localhost IDENTIFIED BY "@Aksshaay1";
MariaDB [(none)]>GRANT ALL PRIVILEGES ON joomla_database.* TO aksshaay@localhost;

here I am creating a database named “joomla_database” , “aksshaay” is a user of the database with password “@Aksshaay1” and grant permissions for “aksshaay” on all the tables of “joomla_database”.

now use below commands to reload grant tables and exit.

MariaDB [(none)]>FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

by  running the command FLUSH PRIVILEGES ,it will reloads the grant tables in the database making the changes to take effect without the need of reloading or restarting service.

Step-3:Download joomla installation files and change permissions

To download joomla installation files I am using “wget”  it will download a zip file extract these files using “unzip”, use below command to install “wget” and “unzip”, if not already done.

yum install wget unzip -y

Now to download and unzip joomla files use below commands.

wget https://downloads.joomla.org/cms/joomla4/4-1-4/Joomla_4-1-4-Stable-Full_Package.zip format=zip
unzip Joomla_4-1-4-Stable-Full_Package.zip?format=zip -d  /var/www/html/joomla

execute below commands to change the owner of joomla files to apache user and permissions of the files.

sudo chown -R apache:apache /var/www/html/joomla/
sudo chmod -R 755 /var/www/html/joomla/

Step-4: Create an apache virtual host file for joomla
Now  we will configure a virtual host file that will tell the server where to access the joomla website files, create a file named “joomla.conf” at /etc/httpd/conf.d and “vi” is the editor in the below command.

sudo vi /etc/httpd/conf.d/joomla.conf

paste the below given content in your joomla.conf file, use your public-ip for “ServerName”

<VirtualHost *:80>

ServerAdmin aksshaaynalmas@gmail.com
DocumentRoot "/var/www/html/joomla"
ServerName 3.110.121.112
ErrorLog "/var/log/httpd/mysite.example.com-error_log"
CustomLog "/var/log/httpd/mysite.example.com-access_log" combined

<Directory "/var/www/html/joomla">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>

</VirtualHost>

Now restart httpd using below given command

systemctl restart httpd

before configuring joomla with database on the browser allow traffic on port 80 using firewall, use below command to install firewalld, if not done already.

yum install firewalld -y

firewalld services are rules which help you to open and allow a certain connection within our firewall to our server, now start and enable firewalld, by enabling a service it will start at every boot.

systemctl enable --now firewalld

To open port 80(http) and and allow traffic use below command

firewall-cmd --add-service=http --permanent && firewall-cmd --reload

Step-5: Complete joomla configuration from web browser

Copy your public-ip on to the web browser

give your site name here and click on “Setup login data”

Next create a user and give your email then click on “Setup Database Connection”

give the database name , database user name and password that you have created in step-2 and click on “install Joomla”

 

Login as admin using username and password you have created , that’s it you have installed and configured joomla on your machine.

 

 

If you have any requirements for CMS development or support, please feel free to get in touch with us. Our 24X7 offshore engineering team would be delighted to assist you.

 

Leave a Reply

Your email address will not be published.

*