AWS website hosting with database connection-Part1

Опубликовано: 15 Февраль 2026
на канале: Cloudlearning
70
2

In this lab we are hosting a static php website on EC2 which is using RDS database for displaying data.
or connecting Public subnet ec2 with private subnet Database
or Creating Multi Tier website
or Creating VPC,Internet gateway,Route table,EC2,RDS

Disclaimer: Data has been taken from AWS sites you can find details on AWS.Only purpose of this lab to show you hosting webiste with solving errors to get better understanding.


below script you can add in user data while launching ec2 or you can run line by line on ec2 instance from second line(yum -y update)


#!/bin/bash -ex
yum -y update
yum -y install httpd
yum -y install php
sudo yum install https://dev.mysql.com/get/mysql80-com...
sudo systemctl enable --now mysqld
chkconfig httpd
on
service httpd start
cd /var/www/html
wget https://us-west-2-aws-training.s3.ama...
tar xvfz app.tgz
chown apache:root /var/www/html/rds.conf.php