AWS 2 Tier Architecture on a Joomla-Based Website

Kaylen Anderson
4 min readJul 7, 2024

--

Business Case Scenario:

Adventure Works is a forward-thinking travel agency specializing in adventure tours and global travel packages. They offer diverse experiences including mountain trekking, safaris, cultural immersion trips, and luxury cruises. To boost customer engagement and operational efficiency, Adventure Works is launching a new Joomla-based website. Their goal is to create an interactive central hub for all travel services that is scalable, secure, and highly available, capable of supporting future growth and increased traffic.

Prerequisites:

Familiarity with AWS services:

  1. VPC
  2. Subnets
  3. EC2 Instance, Ubuntu

Step 1: VPC and Subnets

  • Create a new VPC.
  • Create a new IGW (Internet Gateway) if you do not have one already made.
  • Create four new subnets, two public and two private. With two or more AZ’s (Availability Zones).
  • Use the rotate table to connect the public subnet to an IGW (internet Gateway).
  • Create another route table for your private subnets

Step 2: Apache install with Joomla configurations

  • Launch an Ubuntu EC2 instance in the new VCP and public subnet. Make sure your security group allows port 22 and 80 traffic. This EC2 instance will host our Joomla application.
  • SSH into the EC2. Check for any updates then install Joomla.
  • Use nano to edit the Apache configuration file. Adjust the DirectoryIndex setting by reordering the “index.php” so that it comes before “index.html”.
sudo nano /etc/apache2/mods-enabled/dir.conf

Step 3: Launch a MySQL RDS instance

  • Go to the Amazon RDS console and create a “DB subnet group” associate the previously made public and private subnets.
  • In the a Amazon RDS console locate “Databases” click it then click “Create database”. Create a MySQL database.
  • Use the free tier template.
  • Under the credentials settings, set the master username as admin. Then create a master password.
  • Connect your EC2 instance to your DB under the Connectivity section.
  • Under “DB subnet group” select “Choose existing” and select the DB subnet group previously made. Be sure to select no under “Public access”.
  • Selecte “Create a new VPC security group”. This new security group will allow the EC2 instance to access the database.
  • For the Database authentication section select “Password authentication”
  • Enable Monitoring.
  • Review configurations and click “Create database”. Allow time for database to be created.

Step 4: Joomla installation continued

  • Go to your EC2 instance in the EC2 console and open the private IP address in your browser.
  • Follow the Joomla setup instructions on the webpage.
  • When asked for the “Host Name*” enter the RDS endpoint from the database previously created.
  • Username of admin. We gave this name right before we create a master password during the creation of the database.
  • For “Password*” use the password created for the database.
  • “Database Name” enter the name of your database. Leave “Table Prefix” as is, then click next.
  • Error notice, follow the instructions to delete the _JoomlazR3fD0AnFpM4aWGO5Oqa1.txt file in the CLI. This lets Joomla know that you are the owner of the website. Go back to your Joomla website reenter your password then click next.
  • Review configurations and select “Blog English (GB) Sample Data” then click install.
  • Secure your data further by removing the Joomla Installation Dirictory. In the terminal enter the command below
 sudo rm -rf /var/www/html/installation
  • Allow time for the website to update then test that it is working properly by reopening the EC2 IP address in the browser.

Benefits of a two tier architecture:

Implementing a two-tier architecture for Adventure Works offers multiple benefits. Some benefits are:

1. Scalability: Allows independent scaling of front-end and back-end servers. By separating the web server from the database sever we optimizing resource usage as traffic grows.

2. Performance: Separates user interaction (front-end) from data processing (back-end), improving overall response times and user experience.

3. Security: Enables focused security measures on both tiers, protecting against different types of threats and enhancing overall system resilience.

4. Flexibility and Maintenance: Facilitates easier updates and maintenance of each tier independently, adapting to evolving technology and business needs more effectively.

5. High Availability: Supports redundancy and load balancing at both tiers, ensuring continuous operation and minimizing downtime for users.

In summary, a two-tier architecture aligns with Adventure Works’ goals by providing a scalable, secure, and high-performance foundation for their new website.

Troubleshooting:

How to install Joomla:

  • For the step by step install of Joomla visit Joomla .

Adding subnets to the same route table:

  • Go to the VPC dashboard and locate “Route tables”, then select it.
  • Select the route table you’d like to associate another subnet to. then locate “Subnet association” click it. Next click edit subnet association.

Deleting Joomla installation before installation is complete:

  • Go into the terminal and unzip the joomla.zip files.
  • Overwrite all files using “A”. Then use nano to edit the Apache configuration file. Revisit Step 2: Apache install with Joomla configurations of this article for more detail.
  • Follow the EC2 IP4 address to website and redo the web installation.

Refreshing the browser after deleting the installation directory:

  • You will receive an error if you simply try to refresh the web browser after completing the installation then deleting the installation in the CLI. The reason being is that the you were using the DNS address for the installer that no longer exsit. Instead go back to your EC2 console, select your EC2 instance then locate “Public IPv4 address” and select open address.

--

--