This repository contains a multi-tier banking application deployed on an AWS EC2 instance. The application is implemented using Java for the UI and MySQL for the database. This guide explains how to set up and deploy the project.
-
AWS EC2 Instance
- Instance Type:
t2.micro
(or higher, based on requirements) - Operating System: Ubuntu 20.04 (or your preferred OS)
- Instance Type:
-
Mobaxterm
- Used for SSH access to the EC2 instance.
-
Java Development Kit (JDK)
- Ensure Java is installed on the instance.
-
MySQL Server
- Installed for the database layer.
-
Maven
- Used for building and packaging the Java application.
- Create and start an EC2 instance with the necessary security group settings.
- Allow inbound traffic on ports
22
,8080
(HTTP).
Use Mobaxterm or your preferred SSH client to connect to the instance:
ssh -i your-key.pem ubuntu@<public-ip>
Install Java to support the application:
sudo apt update
sudo apt install openjdk-11-jdk -y
Set up the database server:
sudo apt install mysql-server -y
Log in to MySQL:
sudo mysql -u root
Change the root user password:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Test@123';
FLUSH PRIVILEGES;
Run the following commands to create and configure the database:
CREATE DATABASE bankappdb;
USE bankappdb;
-- Add necessary SQL queries to populate tables
SHOW DATABASES;
SHOW TABLES;
Clone the project and build it using Maven:
mvn compile
mvn test
mvn package
Navigate to the target
folder to verify that the .jar
file was created.
Start the application using the following command:
java -jar target/<filename>.jar
The application will start on the Tomcat server, accessible on port 8080
.
Access the application in a web browser using the EC2 Public IPv4 address and port 8080
:
http://<EC2-Public-IPv4>:8080
- Ensure security groups allow traffic on port
8080
. - Use strong passwords for MySQL and secure your EC2 instance.
- Always test your changes locally before deploying to EC2.