The wait is over! Welcome to Week 4.
Congratulations! ๐ I just crossed the halfway mark of this bootcamp ๐คฉ๐๐พ๐๐ฅณ๐
Case Study: Deploying a Website
A client needs to deploy their website or blog on a public domain, making it easily accessible worldwide via a shared URL. Let's dive into the solution together.
Overview:
Let's get started!
Let's Dive in as we explore the solution together. We'll cover:
- Deploying a website on a public domain using EC2
- Step-by-step guide
- Understanding EC2's features and benefits
- Graphical illustrations
- Hands-on steps to resolve the case study
Solution
Introducing EC2: Elastic Cloud Compute
To solve this problem, we'll utilize Amazon Web Services (AWS) popular service: EC2 (Elastic Cloud Compute). But what is EC2? ๐ค
EC2 provides scalable computing capacity in the cloud, allowing users to run and manage applications seamlessly.
Why EC2? EC2 is a popular choice for many reasons in terms of the following:
Scalability: Quickly scale up or down to match changing workloads and applications.
Flexibility: Choose from a wide range of instance types, operating systems, and configurations.
Reliability: Enjoy high uptime and reliability, with built-in redundancy and failover capabilities.
Security: Leverage robust security features, including network isolation, firewalls, and encryption.
Cost-effectiveness: Pay only for the resources you use, with no upfront costs or long-term commitments.
Integration: Seamlessly integrate with other AWS services, such as storage, databases, and analytics.
Global reach: Deploy applications in multiple regions and availability zones, with low latency and high performance.
Automation: Easily automate tasks and workflows using AWS tools and services.
Support: Access comprehensive documentation, tutorials, and support from AWS and the community.
In summary: EC2 should give me a virtual machine on your cloud platform (AWS) which is elastic in nature.
Letโs dive with graphical illustrations:
Section A
Step 1: Open your AWS management console.
Step 2: Locate EC2.
Step 3: Give your server a server.
Step 4: Select AMI and instance type
Step 5: Create and type the name key.
Congratulation!, You have created your first instance.
Section B
Now, letโs deploy our server. Steps to deploy server.
Step 1: Click on Connect, and it prompt this page to connect to our server. Select SSH client.
Step 2: Open your Gitbash (open SSH client).
Step 3: Make sure your directory is located at where your key and run the command line.
chmod 400 "cloud-jay-key.pem"
Step 4: run the second command line and it request your permission: Yes / No click on Yes to continue
When you type yes. It shows this
Step 5: run this command line:
ssh -i "cloud-jay-key.pem" ec2-user@ec2-34-204-186-40.compute-1.amazonaws.com
Step 6: check the updated version.
Step 7: install nginx, prompt yes or now. Click โyesโ to install
Before installation of nginx ==> after installation of nginx
Step 8: checking the version of nginx
Step 9: Test if the nginx is running.
Step 10: set up inbound rules
Step 11: click on security rules then click on edit inbound rules
Step 12: select the option in sequence.
Step 13: now inbound rules in set.
Step 14: Test if the localhost is running.
Step 15: Check the status the nginx (it shows the status is disable)
Step 16: Start enable nginx and check the status if it enables or running.
Step 17: Letโs confirm if nginx is running on web browser. (copy public IP address and run it on browser: e.g [google chrome, opera, Mozilla, Brave etc.]).
Congratulation!, Nginx is running on web browser.
Steps to setup an nginx webserver:
- Create the ec2 instance - amazon linux.
- Connect via ssh using the key on git bash
- Update the instance using (sudo yum update)
- Install the nginx package (sudo yum install nginx)
- Check if installed (nginx โv)
- Test using (curl localhost)
- Check if nginx is running (sudo systemctl status nginx)
- Start nginx using (sudo systemctl start nginx)
- Check the status again using step 7
- Test using the public IP.
- Check and allow traffic on your security group by adding http port 80 rule on IPv4.
Section C
Step Letโs deploy our blogspot on nginx as client requested.
Sample of the website deploy.
Step 1: We are using a readymade blogspot to deploy our first website for the client. Right click and copy link address.
Step 2: Enter the dir of nginx html (cd /usr/share/nginx/html) and ls
Step 3: enter the copied link with the command line:
sudo wget https://github.com/StartBootstrap/startbootstrap-agency/archive/gh-pages.zip
Step 4: Unzip the file. Run the command line
sudo unzip gh-pages.zip
you can list (view)
ls
Step 5: now that we have deployed our website, let rename and replace it with our public IP.
Now the public IP address is replaced with the website. Letโs confirm on web browser.
Congratulations! You've successfully deployed a website on a public domain, making it accessible globally. Please note that the website will be available for access within 12 hours after publication. Unfortunately, I won't be able to keep it running indefinitely due to incurred charges.
URL: 34.204.186.40
Please let me know in the comments if you're able to access the website.
That concludes our Week 4 article! Feel free to reach out to me with questions or to practice what we've covered. Remember, practice is key to mastering these skills.
We're just four weeks away from completing our junior cloud engineering journey! ๐
Stay awesome, everyone! Looking forward to seeing you in my next article. ๐
Top comments (0)