Pps
Pps
Frontend VPC
1. Go to the VPC Dashboard:
o Navigate to the VPC service in the AWS Management Console.
2. Create a VPC:
o Click on Create VPC.
3. Create Subnets:
o Navigate to Subnets.
5. Route Tables:
o Navigate to Route Tables.
o Configure security group to allow HTTP (port 80) and SSH (port 22).
bash
Copy code
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
o Place your frontend application files in /var/www/html.
bash
Copy code
sudo yum update -y
sudo yum install -y mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
o Secure MySQL installation:
bash
Copy code
sudo mysql_secure_installation
o Create a database and user:
sql
Copy code
mysql -u root -p
CREATE DATABASE myapp;
CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'%';
FLUSH PRIVILEGES;
Jump Server
1. Launch EC2 Instance:
o Similar to frontend, but in "BackendVPC" with a public subnet.
o Security group should allow SSH (port 22) only from your IP.
Step 4: Autoscaling
1. Create an Auto Scaling Group:
o Navigate to Auto Scaling Groups under EC2.
o Name the group and select the frontend EC2 instance launch
configuration.
o Set the VPC to "FrontendVPC" and select public subnets.
o Attach it to "BackendVPC".
2. Create an A Record:
o In the hosted zone for your domain, create an A record pointing to
the public IP of the ALB.
Step 8: Operations and Testing
1. Access the Frontend Application:
o Use the domain name to access the frontend.