0% found this document useful (0 votes)
31 views40 pages

Practical File

The document is a practical file for a Cloud Computing course at Chitkara University, detailing various hands-on exercises related to AWS services. It includes steps for signing up for AWS, launching EC2 instances, configuring web servers, and managing security groups. Each practical aims to provide students with essential skills in cloud computing and AWS management.

Uploaded by

parthjrnarang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views40 pages

Practical File

The document is a practical file for a Cloud Computing course at Chitkara University, detailing various hands-on exercises related to AWS services. It includes steps for signing up for AWS, launching EC2 instances, configuring web servers, and managing security groups. Each practical aims to provide students with essential skills in cloud computing and AWS management.

Uploaded by

parthjrnarang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Department of Computer Science & Engineering

Chitkara University Institute of Engineering & Technology


(Accredited by NAAC with Grade ‘A+’)

Practical File

Cloud Computing (23CS009)

BACHELOR OF ENGINEERING

in

Computer Science and Engineering

Submitted by: Submitted to:


Student name- Aryan arora Faculty Name pummy dhiman
Roll No- 2310994768 Designation- assistant professor
Group No- G14
Semester- 5th
Year- 3rd

CHITKARA UNIVERSITY, PUNJAB


CHANDIGARH-PATIALA NATIONAL HIGHWAY
RAJPURA (PATIALA) PUNJAB-140401 (INDIA)
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

INDEX
Practica Practical Name Page No.
l No.
1. Sign up for AWS, explore free-tier services, and launch EC2
instances using Ubuntu/Linux and Windows operating systems.

2. Connect to an EC2 instance via EC2 Connect, SSH Client, AWS


CLI, and PuTTY SSH Client using a key pair file.
Access and modify Security Group inbound and outbound rules to
control traffic for EC2 instances.

3. Set up and configure web servers on EC2 instances, including


Apache and Nginxserver. Configure auto-scaling for EC2
instances to handle variable traffic.

4. Create an Amazon S3 bucket, upload objects, set up access


controls with bucket policies, and use it for hosting static content.

5. Set up an AWS Elastic Load Balancer (ELB) to distribute traffic


among EC2 instances.

6. Set up Amazon VPC networking, including subnets, route tables,


security groups.
Scenario 1: VPC With a Public Subnet Only (Standalone Web)
Scenario 2: VPC with Public and Private Subnets (3 Tier App)

7. Configure Amazon CloudWatch to monitor EC2 instance metrics


and set up alarms.

8. Create an SNS, subscribe and publish a message, set up an SQS


queue, integrate it with an EC2 instance, and use SES to send
event notifications via email.
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Practical No. 1:

Practical Title: Sign up for AWS, Explore Free-Tier Services, and Launch
EC2 Instances using Ubuntu and Windows

Objective:
• To create an AWS account and explore free-tier services.
• To launch an EC2 instance with Ubuntu and Windows OS.

Step-by-Step Procedure with Screenshots:


Step 1: AWS Account Signup

 Course Invitation Email

 I received an email titled “Course Invitation” from AWS Academy.


 The course is named AWS Academy Learner Lab [126939].
 My name and email were listed, and i am invited as a Student.
 The email provided a "Get Started" button to begin registration.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 1
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

 Click on “Get Started”

 After clicking the button, I am redirected to the AWS Academy login portal.

 Choose Login Type

 I am presented with two login options:


o Student Login
o Educator Login
 Since I am a student, I clicked on Student Login.

 Login with Credentials

 You entered your username (your email address) and password.


 Then clicked Log In.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 2
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

 Accessing Your Dashboard

 After logging in, your Dashboard loaded successfully.


 You can now view:
o Modules
o Discussions
o Grades
o Lucid (Whiteboard)

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 3
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

 Verifying Your Account

 By clicking on Account, you could verify that your email (username) is correct.
 The interface shows options like:
o Notifications
o Files
o Settings
o Create a Class
o And toggles for UI customization (High Contrast, Dyslexia Font)

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 4
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 2: Exploring AWS Free-Tier Services

Step 3: Launching EC2 Instances (Ubuntu & Windows)

(a) Launching an Ubuntu EC2 Instance

(b) Launching Windows EC2 Instance

1. Repeat Steps 1-3 from Ubuntu EC2 Instance and choose Windows Server 2022 AMI.
2. Configure Security Group: Allow RDP (Port 3389) for remote desktop access.
3. Create a Key Pair: Download the key file for decrypting the administrator password.
4. Launch and Connect: Click "Launch" and wait for the instance to start.
5. Get Password: Select Windows instance, click "Get Password", upload key file, and decrypt.
6. Open Remote Desktop Connection (RDP) and enter credentials.

Learning Outcomes:

 Successfully signed up for AWS and explored free-tier services.


 Launched and connected to EC2 instances using both Ubuntu and Windows.
 AWS provides a free-tier environment for cloud computing. We created EC2 instances and
accessed them using SSH (Ubuntu) and RDP (Windows). This experiment demonstrated the
fundamentals of launching and managing virtual machines on AWS.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 5
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Practical No. 2

Practical Title:

EC2 Connect, SSH Client, AWS CLI, and PuTTY SSH Client can all be used to connect to
an EC2 instance using a key pair file. To manage EC2 instance traffic, change the inbound
and outgoing rules for the Security Group.

Objective:

• EC2 Instance Connect, SSH Client, AWS CLI, and PuTTY SSH Client with a key pair file
are the several ways to connect to an EC2 instance.
• To change Security Group outgoing and inbound rules to permit or prohibit traffic.

2.1 Connect via EC2 Instance Connect (Browser)

Theory:

EC2 Instance Connect is a browser-based method to connect to EC2 instances without any
local key files. It’s useful for quick troubleshooting and fast access.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 6
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step-by-Step Instructions:

Step 1 – Navigate to EC2 Instances:

 Select Services → EC2 → Instances → Running Instances in the AWS Console.

Display your instance running on the EC2 Dashboard (Instance ID, Public IPv4, Instance
State).

Step 2 – Click Connect Button:

 Select your running instance → Click Connect on the top.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 7
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Show the Connect tab with EC2 Instance Connect (browser-based) selected.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 8
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 3 – Connect to Instance:

• Click Connect to launch the Terminal window.

Display the terminal window associated with your EC2 instance, for example, [ec2-user ~]
$.

2.2 Connect via SSH Client (Linux/Mac Terminal)

Theory:

SSH allows secure remote access using PEM key files to authenticate the session.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 9
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step-by-Step Instructions:

Step 1 – Download PEM Key:


• While building EC2 instance → Download the .pem key pair file.

Display the downloaded PEM file in the EC2 Dashboard → Key Pair area.

Step 2: Launch the Downloads Folder in File Explorer:

Display the.pem key file that is in your Downloads directory.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 10
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 3: Launch the Terminal and type the SSH command.


SSH -i ec2-user@ "Instance1.pem"
For instance:
[email protected] ssh -i "Instance1.pem"

Display the Terminal in which the SSH command is typed.

Step 4-Verify Connection:

The connection was made successfully after accepting the fingerprint.


[ec2-user ~] $

📸 Insert Screenshot: Figure 2.7: After a successful login, display the terminal prompt.

2.3 Connect via PuTTY SSH Client (Windows)

Theory:

PuTTY is an SSH client for Windows that requires a .ppk key format for connecting to EC2
instances.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 11
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step-by-Step Instructions:
Step1- download PuTTY.
Install PuTTY by clicking on https://www.putty.org.

Step 2-Convert PEM to PPK Key:


Open PuTTYgen, then select Load. After choosing a PEM file, save the private key as a.ppk.

Show the PuTTYgen window with the PPK file saved and the PEM file loaded.

Step 3 – Get Public IPv4 DNS:

Copy the Public IPv4 DNS from the Instance Details after selecting your instance from EC2.

A screenshot of the EC2 instance details page with public IPv4 DNS is shown in Figure 2.15.

Step 4 – PuTTY Configuration:

 Open PuTTY →
o Enter in Host Name:
o ec2-user@<Public-IPv4-DNS>

o Under Connection → SSH → Auth → Browse → Select .ppk file.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 12
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Show PuTTY configuration screen with


host name and key selected.

Step 5 – Connect via PuTTY:

 Click Open → Terminal window appears.

Show terminal screen after successful login (with whoami and uname -a command outputs).

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 13
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

2.4 Modify Security Group Rules

Theory:

As a virtual firewall, Security Groups function. Incoming traffic is managed by inbound


rules, which permit SSH or HTTP, for example.
By default, outbound rules usually stay open.

Step-by-Step Instructions:

Step 1 – Go to Security Groups:

To access Security Groups, click to AWS Console → EC2 Dashboard → Left Menu

Make the Security Groups list visible.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 14
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 2 – Edit Inbound Rules:

• Pick the Security Group. To edit the inbound rules, click Inbound Rules.
Add Rule →SSH Type → Port: 22 → My IP is the source.

The type is HTTP, the port is 80, and the source is anywhere (0.0.0.0/0).

Before and after adding rules, display the Inbound Rules editing panel.

Step 3 – Save Changes:

 Click Save rules → Rules applied successfully.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 15
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Show final inbound rules with SSH and HTTP visible.

Learning Outcomes:

• Three methods for connecting to EC2 instances were taught to me:


o Browser-based EC2 Instance Connect o SSH Client (Linux/Mac terminal)

The PuTTY client for Windows.


• I obtained practical experience downloading and utilizing key pairs (.pem and.ppk).
• I was able to adjust inbound/outbound rules and understood the significance of security
groups.
• I become more skilled at EC2 connectivity issues.

Practical No. 3

Practical Title:
Install and set up Apache and Nginx web servers on EC2 instances.
To handle irregular traffic, set up Auto Scaling for EC2 instances.

Objective:
• Install and set up Nginx and Apache web servers on EC2 instances.
• Set up Auto Scaling to manage fluctuating traffic automatically.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 16
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

3.1 Set up and Configure Web Server (Apache)

Theory:
One well-known web server program for serving web content is Apache.
After installing it on an EC2 instance, we build a basic webpage that can be visited using the
public IP of the instance.

Steps to Follow:

Step 1 – Launch EC2 Instance


To start an EC2 instance (Amazon Linux 2, t2.micro), follow the instructions in Practical 2.
Check that the Security Group permits SSH (Port 22) and HTTP (Port 80) incoming.

An EC2 instance operating with key settings (Security Group permitting HTTP & SSH) is
shown in Figure 3.1.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 17
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 2 – Connect to EC2 Instance (EC2 Instance Connect)

Terminal screen after successful login to EC2 instance.

Step 3 – Install Apache Web Server


sudo yum update -y
sudo yum install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 18
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Terminal showing successful Apache installation and service started.

Step 4 – Create a Sample Web Page


cd /var/www/html
echo "<h1>Hello from Apache Web Server on AWS!</h1>" | sudo tee index.html

Step 5 – Test Apache Web Server

 Copy Public IPv4 Address → Open browser →


http://your-public-ip

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 19
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Browser showing webpage:


"Hello from Apache Web Server on AWS!"

3.2 Set Up and Configure Web Server (Nginx)

Theory

High-performance web servers like Nginx are made capable of handling many connections at
once.
Because of its event-driven architecture, Nginx is quicker than Apache in handling many
connections at once and serving static files.
It is frequently used as a reverse proxy for load balancing and to serve web applications.

Step 1:

 Create a New EC2 Instance for Nginx Web Server 1️⃣ Locate EC2 → Search on the
AWS Console

Select "Launch Instance."


Set Up the Instance:
• AMI: Choose the SSD Volume Type and Amazon Linux 2 AMI (HVM).
• Instance Type: Select t2.micro (qualified for free tier).

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 20
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)


3. Create or use the same key pair as Apache step → (MyKeyPair.pem, for example)
→ Download the.pem file if you're creating a new key pair.

4. Set up the Security Group:
• Establish a new security group or reuse an existing one.
• Incorporate Inbound Rules:

Type Protocol Port Range Source

SSH TCP 22 My IP (for secure SSH access)

HTTP TCP 80 Anywhere (0.0.0.0/0)

: Instance summary page showing the newly created Nginx instance with Public IPv4 and
Instance ID.

Step 2 – Connect to EC2 Instance via EC2 Instance Connect (Browser-based)

First, click to EC2 → Instances → Choose the fresh instance of Nginx →


From the top menu, select Connect →
Select EC2 Instance Connect (SSH via browser) →

Tap "Connect."

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 21
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Terminal showing successful connection to the EC2 instance.

Step 3 – Install Nginx Web Server

Inside the EC2 terminal, execute the following commands step by step:

sudo amazon-linux-extras enable nginx1


sudo yum install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx

✔️These commands do the following:

 Enable Nginx repository on Amazon Linux.


 Install Nginx.
 Start the Nginx service.
 Set Nginx to start automatically on reboot.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 22
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

: Terminal showing successful Nginx installation and confirmation that the service is running.

Step 4 – Create Simple Web Page

1️Navigate to the default Nginx web server directory:

cd /usr/share/nginx/html

2️Inject a simple HTML page:

echo '<h1>Hello from Nginx Web Server on AWS!</h1>' | sudo tee index.html

This creates or replaces the index.html file so that the web server shows a custom message.

Step 5 – Test Nginx Web Server

1️⃣In AWS Console →


Select your Nginx instance →
Copy the Public IPv4 Address.

2️Open a browser →
Type:

http://<public-ip>

Example:

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 23
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

http://54.221.33.44

Browser displaying the message:

Hello from Nginx Web Server on AWS!

3.3 Configure Auto Scaling for EC2 Instances

Theory
AWS Auto Scaling facilitates dynamically modifying the quantity of EC2 instances in
reaction to fluctuating load or traffic.

• High availability (additional instances spinning up as needed) is ensured by this.


• Cost-effectiveness (when necessary, instances shrink down).

Instances are automatically started or stopped by Auto Scaling Groups (ASG) according to
with established guidelines (such as a CPU utilization threshold).

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 24
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 1 – Create an AMI (Amazon Machine Image) from EC2 Instance

1️Go to AWS Console → EC2 Dashboard → Instances.

2️Select the running EC2 instance (with Apache or Nginx installed).

3️From the Actions dropdown →


Select → Image and templates → Create Image.

4️Fill in the form:

 Image Name: Example → autoscale-webserver-ami


 Description (optional).

5️Click Create Image.

6️Wait for the AMI creation to finish.


👉 Navigate to Images → AMIs →
Confirm the new AMI appears and its status is Available.

Screenshot showing the AMI creation form filled and AMI listed in the console.

Step 2 – Create Launch Template

1️Navigate to EC2 Dashboard → Launch Templates → Create launch template.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 25
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

2️Fill in the form:

 Launch template name: Example → autoscale-launch-template


 Application and OS Images (AMI): Select the AMI you created earlier
(e.g., autoscale-webserver-ami).
 Instance Type: t2.micro (for free-tier).
 Key Pair: Select the same key pair used earlier.
 Security Group: Select the security group allowing SSH (22) and HTTP (80).

3️Click Create Launch Template.

: Screenshot showing the filled Launch Template creation form.

Step 3 – Create Auto Scaling Group

1️Navigate to EC2 Dashboard → Auto Scaling Groups → Create Auto Scaling Group.

2️Steps to follow:

 Auto Scaling Group Name: Example → webserver-auto-scale-group.


 Select the Launch Template you created earlier.

3️Configure Network:

 Select same VPC as the instance.


 Select appropriate Subnets (e.g., two or three for high availability).

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 26
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

4️Set Group Size:

Setting Value

Desired Capacity 1

Minimum Capacity 1

Maximum Capacity 3

5️Click Next and proceed through the wizard →


Accept defaults (unless you want advanced configurations).

6️Click Create Auto Scaling Group.

Auto Scaling Group creation form showing desired capacity, template selected, and subnets.

Step 4 – Configure Scaling Policy

1️In the Auto Scaling Group wizard →


Under Configure Scaling Policies → Select Target tracking scaling policy.

2️Set the policy:

 Target value: 50% CPU Utilization.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 27
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

3️Save the policy.

: Screenshot showing Target Tracking CPU Utilization policy set to 50%.

Step 5 – Test Auto Scaling in Action

1️Generate Load:

 Open the web page in browser multiple times from different devices →
(e.g., http://<public-ip>).

Or use a load testing tool like Apache JMeter, ab (Apache Benchmark), or simply
refresh many times in parallel.

2️Observe Behavior:

 Go to EC2 → Instances section.


 Watch as new EC2 instances automatically spin up when CPU usage goes beyond the
threshold.

3️After load decreases →


Extra instances should terminate automatically.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 28
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

: Screenshot showing multiple EC2 instances running as part of the Auto Scaling Group after
load test.

Learning Outcomes:
 • Obtained the capacity to set up Security Groups and start EC2 instances.
• Nginx and Apache web servers were installed and configured.
• Using AWS, hosted basic webpages.
• Developed an Auto Scaling launch template and AMI.
• Auto Scaling Group was set up to scale EC2 instances automatically in response to
CPU load.
• Acquired practical knowledge of cloud availability, scalability, and web server
administration.

Practical No. 4
Practical Title:
To host static data, create an Amazon S3 bucket, upload items, and use bucket policies to set
up access controls.

Objective:
• To gain knowledge about setting up and creating an Amazon S3 bucket for data storage.
• To get experience managing and uploading objects (such as HTML, CSS, and photos).
• To understand how to configure access restrictions and bucket policies for both public and

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 29
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

limited access.

• To obtain experience using Amazon S3 to host static content, such as a basic website.
• To gain a basic understanding of S3 as a cloud-based web hosting and storage solution.

Step 1 – Log in to AWS Management Console

Theory:
Files containing HTML, pictures, CSS, and JavaScript can be stored on the cloud-based
object storage service Amazon S3 (Simple Storage Service). First, we'll log into the AWS
Console.

Steps:

First, launch a web browser.


2. Click here: https://aws.amazon.com
3. Select Sign in to Console.

4. Type in your credentials for your AWS account.


5. Using the search box at the top after logging in, type S3.
6. Select S3 service to begin the dashboard's display.

– Screenshot showing navigation to S3 in AWS Management Console.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 30
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 2 – Create an S3 Bucket

Theory:
Similar to a container, an S3 bucket holds objects (files). The names of each bucket must be
globally unique.

Steps:

First, select "Create bucket."


2. Type in the information below:
o Name of bucket:

My-static-website-bucket-unique is an example.
o Region: Pick a region that is close to where you are (for example, ap-south-1-Mumbai).
3. Uncheck the following box in the Block Public Access Settings for This Bucket: ♔ Block
all public access →
We need to do this in order to host information that is accessible to the public.
4. Verify the caution of making the bucket public.
5. Click Create bucket.

– Screenshot showing filling in bucket name and region.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 31
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

– Screenshot showing unchecking public access block.

– Screenshot showing successful creation of the S3 bucket.

Step 3 – Upload Objects (HTML, CSS, Images)

Theory:
Website files (HTML, CSS, and pictures) can be objects in S3. A static website can be
created using these files.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 32
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Steps:

1. Open the S3 bucket you created.


2. Select Upload → Add Files →
3. Pick your files:

o Example: index.html → Main page.


Any.png,.jpg, or.css files for pictures and styles can be used to create an error page.
4. Click Upload → Wait for the upload to finish.

– Screenshot showing selecting website files to upload.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 33
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

– Screenshot showing uploaded files listed inside the bucket.

Step 4 – Set Up Bucket Policy for Public Access

Theory:
S3 automatically prevents public access. To make the files in the bucket accessible to the
general public, particularly for static hosting, we require a bucket policy.

Steps:

1. Go to your bucket's Permissions tab.


2. Click Edit after scrolling down to Bucket policy.
3. Copy and paste the policy below, changing the bucket name to your own:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-static-website-bucket-unique/*"
}
]
}

4. Click Save changes.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 34
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Step 5 – Enable Static Website Hosting

Theory:
Static webpages can be maintained using S3. This needs to be enabled, and the entry point
should be our index.html.

Steps:

1. Go to your S3 bucket's Properties tab.


2. Click to Static Web Hosting →
3. Select Edit →

4. Choose "Enable hosting for static websites."


5. Set up: o Error Document → error.html o Index Document → index.html
6. Select Save Changes.

Step 6 – Test Static Website Hosting

Theory:
A special public URL to view your hosted website is provided by S3 once it is enabled.

Steps:

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 35
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

1. Once static hosting has been activated, copy the Bucket Website Endpoint URL, which
appears as follows:
2. http://my-static-website-bucket-unique.s3-website-ap-south-1.amazonaws.com

3. Open the URL in a web browser. Your personalized webpage, such as "Hello from my
AWS S3 Static Website," should appear.
4. The test error page
If you visit the incorrect path (http:///wrongfile.html, for example), error.html is supposed to
appear.

– Screenshot showing successful display of index.html.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 36
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

– Screenshot showing successful display of error.html.

– Screenshot showing a sample image displayed from S3.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 37
Department of Computer Science & Engineering
Chitkara University Institute of Engineering & Technology
(Accredited by NAAC with Grade ‘A+’)

Learning Outcomes

By the end of this experiment, I was able to:

• Construct and set up an Amazon S3 bucket at the conclusion of this exercise.


• Use S3 to upload and manage HTML, CSS, and picture files for websites.
• Use Bucket Policy to set up public access to the bucket.
• Turn on and set up S3's static website hosting.
• Use AWS S3 to view and test a fully hosted static website.
• Understand the difference between public and private access to cloud storage.

Cloud Computing /23CS009 Student Roll No./Group No.


Page | 38

You might also like