">
 

Deploying Joomla CMS: Two Tier Architecture on AWS With EC2 and RDS

Iniciado por joomlamz, 31 de Maio de 2026, 16:35

Respostas: 1   |   Visualizações: 19

Tópico anterior - Tópico seguinte

0 Membros e 2 Visitantes estão a ver este tópico.

Olá, pessoal! Estou aqui para discutir sobre a implementação do Joomla CMS em uma arquitetura de duas camadas na Amazon Web Services (AWS), utilizando EC2 e RDS. Essa abordagem é muito interessante, pois oferece uma infraestrutura escalável e segura para hospedar sites e aplicações web.

Em primeiro lugar, é importante entender o que é uma arquitetura de duas camadas. Nesse modelo, a aplicação é dividida em duas partes: a camada de apresentação e a camada de dados. A camada de apresentação é responsável por gerenciar a interface do usuário e processar as requisições, enquanto a camada de dados é responsável por armazenar e gerenciar os dados da aplicação. No caso do Joomla, a camada de apresentação é o próprio CMS, enquanto a camada de dados é o banco de dados.

Agora, vamos falar sobre como implementar essa arquitetura na AWS. A Amazon EC2 é um serviço de computação em nuvem que permite criar máquinas virtuais (instancias) para hospedar aplicações web. Já a Amazon RDS é um serviço de banco de dados relacional que permite criar e gerenciar bancos de dados em nuvem. Ao combinar esses dois serviços, podemos criar uma arquitetura de duas camadas para o Joomla.

Aqui estão os principais pontos a considerar ao implementar essa arquitetura:

* **Segurança**: é fundamental garantir que a comunicação entre a camada de apresentação e a camada de dados seja segura. Isso pode ser feito utilizando SSL/TLS e configurando as regras de segurança da EC2 e do RDS.
* **Escalabilidade**: a EC2 e o RDS oferecem recursos de escalabilidade automática, o que permite que a aplicação se adapte às mudanças no tráfego e na demanda.
* **Desempenho**: a escolha do tipo de instância EC2 e do tipo de banco de dados RDS é fundamental para garantir o desempenho da aplicação.
* **Custo**: é importante considerar os custos de utilização da EC2 e do RDS, bem como os custos de armazenamento e de transferência de dados.

Em resumo, a implementação do Joomla em uma arquitetura de duas camadas na AWS é uma ótima opção para hospedar sites e aplicações web de alta performance e segurança. Com a EC2 e o RDS, é possível criar uma infraestrutura escalável e segura que atenda às necessidades da aplicação.

Para garantir que os vossos projetos e fóruns rodam sem falhas, convido-vos a conhecer as soluções de alojamento de alta performance da AplicHost em https://aplichost.com. Nossa equipe está à disposição para ajudar a configurar e a otimizar a vossa infraestrutura, garantindo que a vossa aplicação seja rápida, segura e escalável. Além disso, oferecemos suporte técnico especializado e uma equipe de desenvolvedores experientes para ajudar a resolver qualquer problema que possa surgir. Então, não hesite em entrar em contato conosco e descobrir como podemos ajudar a levar o seu projeto ao próximo nível!

Deploying Joomla CMS: Two Tier Architecture on AWS With EC2 and RDS



Tópico: Deploying Joomla CMS: Two Tier Architecture on AWS With EC2 and RDS
Categoria: Tutoriais | Programação & Tecnologia
Idioma Principal: Português (Conteúdo de Tecnologia)

Descrição do Conteúdo / Informações:
-------------------------------------------------------------------------
Business Case Scenario:**Company Background: **Joysontech is a travel agency specializing in global adventure tours, such as trekking and luxury cruises. They plan to enhance operations and customer engagement with a new Joomla-based website.

**Project Goal: **Launch a scalable, secure website as a central hub for travel services to support company growth.

Architecture Overview:Two-Tier Architecture:


Web Tier: Uses Apache on an EC2 instance to host Joomla and manage HTTP requests.


Database Tier: Utilizes Amazon RDS for MySQL data management.

Benefits:

• **Scalability: **Independent scaling for web and database tiers.


Security: Isolated database enhances security.


Manageability: Easier maintenance and upgrades.


Reliability: RDS ensures data protection and availability.

Use Case:

Joomla offers robust, flexible CMS features, supporting extensions for dynamic content, booking, and e-commerce, enhancing user engagement.



Overview


In this topic will cover how to setup Web Tier with EC2 instances with Joomla installed, Database Tier with AWS RDS with MySQL database, how to create AMI, Custom VPC, internet gateway, Subnets, auto scaling groups, dynamic scaling policies, Lunch Template, application load balancer and target group on AWS and will start from foundational, advanced, and complex tasks as outlined below.

_Get ready for some fun :)_Foundational:

• Set Up Networking, Web Tier, Database Tier

• Install and Configure Joomla and Security groups

• Test the website and post a sample blog to verify.

Advanced:

• Deploy an Additional EC2 Instance and automate Joomla Installation using user data.

• Set Up an Application Load Balancer (ALB)

• Modify Security Groups to allow traffic from ALB to EC2 and test the Load Balancer

• Test failover and load distribution to ensure high availability.

Complex:

• Create an AMI

• Deploy to an Auto Scaling Group and Configure Auto Scaling Policies

• Test Auto Scaling

• Simulate traffic to test the auto-scaling capabilities.

• Ensure that the Auto Scaling Group maintains at least 2 instances and can scale up to 3 instances as needed.

Check out the step-by-step details on project tiers here



Foundational:


Step 1: Set Up Networking

• Create a Custom VPC:

• Open the VPC Dashboard and Click on "Create VPC" and choose VPC and more option

• For IPv4 configure your CIDR block (e.g., 10.0.0.0/16).

• Create two public subnets (e.g., 10.0.1.0/24 and 10.0.2.0/24).

• Create two private subnets (e.g., 10.0.3.0/24 and 10.0.4.0/24).

• And then click on "Create VPC".

Please note: the VPC and more option will also create internet gateway, attach internet gateway to the VPC, create the route tables and associate them with public and private subnet and will also add route to internet gateway for public subnets.Step 2: Set Up Web Tier

• Launch Ubuntu EC2 Instance:

• Choose an Amazon Machine Image (AMI) for Ubuntu.

• Set instance type, configure security groups (allow HTTP and SSH).

• Choose the VPC you created previously and place this EC2 instance in public-subnet1

• Enable auto-assign public IP and click on "Launch instance"

Step 3: Set Up Database Tier

• Launch MySQL RDS Instance:

• Choose MySQL as the database engine and configure the instance in one of the private subnets.

• Set security group to allow connections from the EC2 instance (allow port 3306 for inbound rules).

• Create Admin user and password to access and setup database connection to Joomla.

Step 4: Install and Configure Joomla

• Access into EC2 instance via SSH and Download Joomla and install Joomla. Full guide and commands here.

• Once you have install Joomla Configure the database settings, and complete the installation.

Full guide and commands here.Step 5: Testing

• Test access to the website and functionality by posting a sample blog.



Advanced:


• Deploy an Additional EC2 Instance:

• Launch another EC2 instance in subnet-public2 through the AWS Console.

• Automate Joomla Installation:

• Once the EC2 instance is launched SSH into it and create a script called install_joomla.sh with the below code.



!/bin/bash




Update Package List:


sudo apt update



Install Apache, PHP, and Required Modules:


sudo apt install -y apache2 php libapache2-mod-php php-mysql php-xml php-gd unzip



Start and Enable Apache:


sudo systemctl start apache2

sudo systemctl enable apache2



Download Joomla:


cd /var/www/html

sudo curl -L -o joomla.zip https://github.com/joomla/joomla-cms/releases/download/3.9.28/Joomla_3.9.28-Stable-Full_Package.zip



Extract Joomla


sudo unzip joomla.zip



Set the correct permissions:


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

sudo chmod -R 755 /var/www/html



Remove the default Apache index.html file:


sudo rm /var/www/html/index.html



Change ownership of /etc/apache2/mods-enabled so we can modify Apache Configuration File:


cd /etc/apache2/mods-enabled

sudo chown -R ubuntu:ubuntu /etc/apache2/mods-enabled



Adjust the Directory Index Setting:




Make sure the index.php comes before index.html. The line should look like this:




DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm


echo "DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm" | sudo tee dir.conf



Restart Apache:


sudo systemctl restart apache2

• Change the ownership of the install_joomla.sh and make it executable Run the script on the EC2 instance to download and install Joomla.

• Once the Joomla installation is done follow the GIF in step 4 in foundations task to configure Joomla through web browser.

• Set Up an Application Load Balancer (ALB):

• Create an ALB and set it to distribute incoming traffic to both EC2 instances.

• Ensure the ALB is associated properly with subnets and security groups.

Please note: Create a security and Target group before creating ALB as its easier that way. I have already created them before setting up the ALB.4. Modify Security Groups:

• Update EC2 instances' security groups to accept traffic only from the ALB security group.

• Test the Load Balancer:

• Validate the ALB's effectiveness in balancing load and handling failovers.

I will stop one of the instance and once the website fails for 2 or 3 consecutive times the ALB will direct all traffic to other health EC2 instance.



Complex:


• Create an AMI:

• Create an AMI from one of the configured EC2 instances to include Joomla installation and configurations.

• Deploy to an Auto Scaling Group:

• Create a Launch Template and an ASG utilizing the created AMI.

• Set parameters for the ASG to maintain between 2 to 3 instances

• Configure the ASG to use the previously created Application Load Balancer

• Configure Auto Scaling Policies:

• Define policies for scaling based on CPU metrics or desired conditions.

• Test Auto Scaling:

• Simulate traffic to test the auto-scaling capabilities.

• To test, you can use a stress test tool like stress:

• I have SSH into both of my instances and install the stress tool.

• Run a command like stress --cpu 8 --timeout 60to simulate high CPU usage.

• I am using htop to track the CPU usage.

After 6–8 min in Auto scaling group under activity tab you can see the its launching 2 new EC2 instances and also check this on EC2 instance Dashboard.

It will automatically scale in when the CPU usage is below 50 percent. So it will Dain the connection and terminate the EC2 instance and maintain the desire/minimum instances stated in ASG.

If this post was helpful, please click the clap 👏 button below a few times to show your support! ⬇


Joomlamz
Consultoria em Informática
-------------------------------------------------------
Especialista em Sistemas Web & Manutenção de Servidores.
A desenvolver o novo AplPortal com suporte a PHP 8.
Precisa de ajuda profissional? Contacte-me.

Tags: