How to Deploy and Host a Joomla website on Alibaba Cloud ECS

Deploy and Host a Joomla website on Alibaba Cloud ECS
- Advertisement -

This step by step guide will walk you through a couple of procedures on how to setup and deploy a Joomla website with Alibaba cloud ECS ( Elastic Compute Service ) Ubuntu 16.04 Apache web Server .

- Advertisement -

Contents

About Joomla

Joomla is a free and open source content management system (CMS) for publishing web content .

Over the years Joomla has become one of the most popular website builders on the web .

The platform is built on a model view controller web applications framework that can be used independently of the CMS and allows you to build powerful online applications .

This platform is user friendly, multilingual, extendable, responsive, accessible, search engine optimized and so much more.

Requirements or Prerequisites

Before we deploy our Joomla instance , we need to fulfill the following requirements . We need to setup an ECS linux server (Ubuntu 16.04 as per writing this article ) with basic configurations .

We shall also allocate administrator (sudo) privileges to a non root user and also configure LAMP ( Linux , Apache , MySQL , PHP ) stack on our alibaba cloud ECS instance .

Deploy Joomla instance on Alibaba cloud ECS

This tutorial will help you to Install and configure Joomla Instance on your Apache Ubuntu 16.04 servers.

Step 1: Launch Alibaba cloud ECS from console.

  1. To launch Alibaba cloud ESC , Login to your account dashboard and click on “Products” at the top bar menu or navigate to the left hand side bar and select Elastic Compute Service . Under ECS menu , Click on “Instance” & select “create instance” from the top right button .

  1. In this tutorial we need to use a linux Ubuntu 16.04 server , follow the five procedures of creating up an instance using the guided steps . Remember under the Image section to select an OS Ubuntu version 16.04 from the drop down list .

The instance you just created will appear in the instance section under your ECS console. Wait for some few seconds as it starts running . You can always manage , connect and run it from this section .

You have now finished setting up the ECS instance with Ubuntu 16.04 linux with your management console . In the next step , we shall now install our Joomla website on the ubuntu ECS instance server .

Installing Joomla on Ubuntu 16.04 ECS instance

In this section i will show you how to deploy and install Joomla website on the ECS instance we have just created in the step above . To install Joomla on our server , we need to first install LAMP (Linux , Apache , MySQL , PHP ) stack , in this guide i will show you how to do this step by step .

Step 1 : Connect to your server

To do this , go to you instance section and click connect from your created instance , you’ll be redirected to the server ( Terminal ) . Enter username as Root and the password you created in the systems configuration step above . If you didn’t create password just continue by clicking enter . You’ll now be logged in to your server as system administrator .

All the commands we shall be using in the following sections below shall be typed in this terminal .

Step 2 : Install packages of Apache

Since Joomla requires LAMP stack to be installed on server , we shall need to download and install Apache .

To install Apache , Update your server (ubuntu) repository list by typing command below .

sudo apt-get update

Then install Apache web server ,

sudo apt-get install apache2

Step 2 : Install MySQL package .

Joomla like most other CMS requires MySQL for it’s backend . So in this section we will need to install MySQL and link it to PHP .

To do this , add the following command below .

sudo apt-get install mysql-server php7.0-mysql

You’ll be asked to enter MySQL password . Enter safe Root password . Do not forget it because you’ll need it in step below .

Complete the installation process of MySQL by entering the commands below .

/usr/bin/mysql_secure_installation

You’ll be asked to enter the MySQL password you just created . Continue with installation process as shown below .

Would you like to setup VALIDATE password plugin ? [Y/N] N

Change the root password ? [ Y/N ] N

Remove anonymous users ? [Y/N] Y

Disallow root login remotely ? [Y/N] Y

Remove test database and access to it ? [Y/N] Y

Reload privilege tables now ? [Y/N] Y

Step 3 : Install packages of PHP

Joomla requires PHP to be installed . Execute the following command to install PHP 7.0 and some required PHP modules .

sudo apt-get install php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-xml php7.0-curl php7.0-json php7.0-cgi

PHP will be installed .

Step 4: Confirm LAMP (Linux , Apache , MySQL) installment

To confirm LAMP stack has been installed on your Ubuntu 16.04 server, follow some of the procedures below.

Open the web browser and navigate to your server’s IP address. You’ll see the Apache2 Ubuntu Default page.

Important to note: To check your servers public IP address, check you ECS Instance dashboard you’ll see two IP addresses both private and public. Use the public IP address to access your website. If you don’t see the public IP address consider setting up an elastic IP address. More information Elastic IP address .


In order to confirm PHP installation on your server, remove the default page and replace it with PHP code below. To do this use commands below.

rm /var/www/html/index.html

Replace with new file : .

touch /var/www/html/index.php

nano /var/www/html/index.php

enter sample PHP code below :

<?php

Phpinfo();

?>

To check your page, navigate to your web browser and enter the public IP address , you’ll see information about php installation , that means LAMP stack has been fully installed on server .

Now remove the index.php file using commands below :

rm /var/www//html/index.php

Step 5 : Install and configure Joomla on ECS instance .

In this step we shall install Joomla on server . Joomla is an open source platform , to use it on server , we shall download it from github using commands below .

Before downloading & installing Joomla , we shall need to enter in apache web servers root .

cd /var/www/html

wget https://downloads.joomla.org/cms/joomla3/3-7.5-Stable-Full-Package.zip

Make sure the version you installed is the latest version , If you’re not sure check out at https://downloads.joomla.org

To unzip the downloaded archive , Install unzip

sudo apt-get install unzip

Unzip the downloaded Joomla Zip file

unzip Joomla_3-7.5-Stable-Full_Package.zip

If you can’t unzip .tar.gz file , use the following commands below .

tar -xvzf Joomla_3-7.5-Stable-Full_Package.tar.gz

Next activate the .htacess file by renaming it .

mv htaccess.txt .htacess

then set the appropriate file permissions :

chown -R www-data /var/www/html

chmod -R 755/var/www/html

Step 6 : Create a MySQL Database and User for Joomla

Joomla makes use of relational databases to store and manage sites and user data . In this tutorial , we shall use MySQL, but for production purposes i recommend you use Alibaba Cloud Apsara DB which is an on demand database service .

We have installed MySQL before , we need to create a database and user for Joomla . To get started , login into MySQL account using the commands below .

mysql -u root -p

You’ll be prompted to enter the MySQL password you created above , After successfully entering it , you’ll be taken to the MySQL shell .

Let’s now create a database for Joomla . You can name it anything you like , in my command below i have used Joomla .

mysql > CREATE DATABASE joomla ;

Remember that every command in MySQL ends with a terminator of semicolon ( ; ) . Create a new user and grant it permission to joomla database . You can replace “user” and “password” with username and password of your choice .

mysql>GRANT ALL PRIVILEGES on joomla.* to ‘ user’@ ‘locahost’ identified by ‘password’;

Now, to flush the privileges so that the current MySQL instance is aware of the recent privilege changes that we have made, Enter command below.

mysql>FLUSH PRIVILEGES ;

Now this part is done , to come back (exit) from MySQL shell use this command :

msql>exit;

Now you should be back to your server terminal .

Step 7 : Complete the installation process through web interface .

Most of the installation process we shall do in a web interface . But before we do that , we need to restart the Apache Web server . Enter the following commands to do that :

systemct1 restart apache2

Open your web browser and navigate to your servers public IP address . You’ll see the Joomla web interface . Continue with the installation process . Enter your MySQL username , password and database in the Database Configuration section . In the case of our tutorial this would be .

Database Type : MySQL

Host Name : localhost

Username : user

Password : password

Database Name : joomla

Table Prefix : joomla_

Old Database Process : Remove .

Fill out the rest of the required information until you finish the Installation process of Joomla website on your web server .

Final Thought :

If you’re planning to deploy a Joomla website for production , I would recommend you use Alibaba Cloud ApsaraDB . Alibaba Cloud ApsaraDB for RDS (Relational Database Service) is an on-demand database service that will free you up from the administrative task of managing a database . This leaves you with more time to focus on your core business .

ApsaraDB for RDS is a ready-to-use service that is offered on MySQL, SQL Server and PostgreSQL. RDS handles routine database tasks such as provisioning, patch up, backup, recovery, failure detection and repair.