??????????? ??????? ???????????????????????? ???????????????????????? ???????? ?????? ?????
Manmohan .
Sr.Executive DevOps Engineer | Ex-DevOps Engineer at Mediamelon.Inc | DevOps | AWS | Big Data | Hadoop | Kubernetes | Jenkins | Docker | AKS | EKS | Azure DevOps | CI-CD | RHCSA8 | RH294 | GitOps | DevSecOpsk
?? TASK DESCRIPTION
??? ???????????? ???????s
?? ???s????? ?????????? ?? ???? ??s?????
?? ???????? ????(/???/???/????) ???? ???s?s???? ?? ???????? ?? ??s ????? ??????.
?? s????? ??????s ?s?? ?? ???? s??? ?s ???????s s????? ?? s??
?? s?????? ?? ??????? ???????? ??????? ?s??? ?????????? ??? ?s??? ??? ?????? ?????? ?s s?? ??????.
?? ??????? ????? ??? ????? ????? ??? ?? ??? ?????? ???? ??? s??????? ??? ??? ???????.
Lets start Doing Task:
C?????????? ?? ??????-???????? ???????? ?????????????? ????????
Let’s confirm from AWS portal key has been created or not.
Create Security Group:
Confirm From Aws Portal
?????? ?????? ?????? ??????? ???????????????? ?????????? ????? ???????? ?????????????? ?????? ????????? ???? ???? ?????????????? ???????? ???????????????????? ??????? ??????? ???????????????? ??????????
?????? ?? ???????? ???????????? ?? ?????????????? ???????? ???????? ???????? ?????????? ???????? ???????????? ???? ?????? ???????? ???????????? ????
Confirm From Aws Portal
??????????? ????? ???????????????? ???????? ????? ?????? ?????? ???? ??????? ????????????????, ???? ???????? ?????????????????? ?????? ?????????????????? ?????? ?????????????? ????????? ??????????????????.
aws ec2 run-instances --image-id { } --instances-type { } --count {} --subnet-id {} --security-group-ids {} --keyname {}
Instance has been launched successfully.
it's time to perform the first step - means configure the webserver.
To configure webserver we use "httpd" software. First, we install the software
The next step would is to add the web pages, but before attaching the volume so that webpage becomes persistent.
Step-2: Document Root(/var/www/html) made persistent by mounting on EBS Block Device.
Before proceed to step to we create one EBS volume and then we mount the root directory (/var/www/html) on the ebs volume. This volume we create because we want to store all my website pages in a separate volume so that due to any reason if my OS crashes, in that case, we do not lose the data.
aws ec2 create-volume --avalability-zone {} --size {} --volume-type {}
New volume of 1gb has created which is not in use.
Once you create the volume then attach with the Instances.
aws ec2 atatch-volume --device {} --instance-id {} --volume-id {}
Now the volume is attached to instances and it is now in use.
Once it is attached, but cannot use it until you do not make a partition and format it.
CREATING PARTITION
fdisk {device name}
FORMATING THE PARTITION
mkfs.ext4 {device name}
After format, mount root directory of httpd(/var/www/html) with the EBS volume Created .
This make /var/www/html made persistent.
I develop the code in html which consist of some images which is a static.
We generally put the static content in the S3. For this crate one S3 bucket and put the static content.
aws s3api create-bucket --bucket task6bucket --region ap-south-1 --create-bucket-configuration LocationConstraint=ap-south-1
We can check from AWS portal that s3 bucket has created
There is no file in the s3 bucket.
Now i will upload the object i.e. image used in my code in the bucket.
aws s3 cp {obejct name} s3://{bucketname} --acl public-read-write
acl refers to the Access Control List. acl is one of the resource-based access policy, that you can manage the bucket access.
we can check from AWS portal that image is uploaded or not.
Finally, place the Cloud Front URL on the web app code for security and low latency.
Now it's time to create Cloud Front in the AWS so that our content would reach each edge location spread all over the world.
aws cloudfront create-distribution --origin-domain-name {}
Now I will write the html code inside the /var/www/html folder. Inside this code I will give the url that is generated from cloud front
Now we can proceed with making HTML pages for the website.
Now I will start the service of httpd
Now using instance ip i will access my webpage from Browser.