How to install Joomla with LEMP stack on CentOS 7 VPS (Part 1) - CloudMinister

Let’s start learning about How to install Joomla with LEMP stack on CentOS 7 VPS (Part 1) in this post…

Joomla is a popular open source Content Management System(CMS), which is used to build websites and online applications. It is separated into front-end and back-end templates.

In Joomla CMS the more focused on portal-like websites.

In this tutorial, you are going to learn how to install Joomla with LEMP(Linux, Nginx, MySQL, and PHP) on CentOS 7 VPS.


Table of Content

  1. Prerequisites
  2. Install MySQL 8.0
  3. Configure Database in MySQL
  4. Install & Configure PHP 7.2
  5. Install Nginx
  6. Configure Firewall
  7. Configure Nginx File
  8. Install Joomla File
  9. Test Joomla

1. Prerequisites

Before you start the installation of Joomla with (LEMP) stack on Centos 7 VPS, you must have one Centos 7 VPS with root privileges on it or you can use sudo for non-root users.

You should also run basis command on the server to check the following things-:

# df -h (To check the disk space on the system.)

# cat /etc/os-release (To verify the version of the VPS.)

# yum -y update (To update all the packages of the VPS)

  1. Install MySQL 8.0

Joomla uses a MySQL database for storage, MySQL is used in the stack for storing user details in the database.

For installing MySQL on Centos 7 first you need to enable MySQL repository and then you can install MySQL.

# yum localinstall -y https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

The command used for installing MySQL in CentOS 7 VPS is as follows:

# yum install mysql-server -y

Then check the MySQL version by typing the following command:

# mysql -V(‘V’ is in uppercase)

After the installation is completed MySQL will start automatically and you can check its status by typing:

# systemctl status mysqld

If MySQL is not start automatically you can write the following command:

# systemctl start mysqld

Before going for the next step you should generate a temporary password to access MySQL root user with the following command:

# grep ‘temporary password’ /var/log/mysqld.log

Now configure the MySQL secure installation to improve the security by typing the following commands.

# mysql_secure_installation

Log in with the temporary password and assign a new password, after that in this configuration asks several questions you can give Y or N according to your requirement.

Change the password for root? N

Remove anonymous users? Y

Disallow root login remotely? Y

Remove test database and access to it? Y

Reload privilege tables now? Y

  1. Configure Database in MySQL

Now create a database for Joomla in MySQL for that first login with MySQL server by using the following command:

# mysql -u root -p

And give its password, after that create a database in it with the command:

mysql> CREATE DATABASE Joomla;

You can also check that database is created or not with the command:

mysql> SHOW DATABASES;

Now create the user and assign him password by using the command:

mysql> CREATE USER ‘joomla’@’localhost’ IDENTIFIED

BY ‘Password’;

After that grant all privileges to the user-created under that database with the command:

mysql> GRANT ALL ON Joomla.* TO ‘joomla’@’localhost’;

Then flush all privileges on the MySQL server with the command:

mysql> FLUSH PRIVILEGES;

Now exit from the MySQL server you can use commands:

mysql> exit;

mysql> \q;

Note-: In MySQL you must end each command with a semicolon(;).

4. Install & Configure PHP 7.2

PHP is used by Joomla to do various functions done by PHP like calling plugin, calling theme, validating user permissions, checking the option, grab from database, etc.

In this Blog, we are using the PHP 7.2 version and install it with epel-release with remi repository.

Firstly, install yum-utils packages using the following command:

# yum -y install yum-utils

After that, install epel-release package by using the command:

# yum -y install epel-release

Then import remi repository from the command:

# yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Enable the remi repository by typing:

# yum-config-manager –enable remi-php72

After that install PHP and all required modules by using command:

# yum -y install php-fpm php-mysql php-mbstring php-xml php-gd php-cli php-json php-opcache php-curl

Now after the installation completed you can check the PHP version with the command:

# php -v (‘v’ is in smallcase)

 

To be Continued…….

Learn how to scale, manage, and optimize your applications with a SLB. Read our solution brief "Get More from Your Enterprise Network".

DOWNLOAD SOLUTION BRIEF

Get started with CloudMinister Today