0% found this document useful (0 votes)
6 views

AWS Nginx Server Setup Using Linux EC2 Instance

This document outlines the steps to set up an Nginx server on a Linux EC2 instance in AWS. It includes instructions for creating an EC2 instance, connecting to it via SSH, installing Nginx, accessing the server, and changing the default page. Finally, it advises on exiting and terminating the instance after use.

Uploaded by

Andrew
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

AWS Nginx Server Setup Using Linux EC2 Instance

This document outlines the steps to set up an Nginx server on a Linux EC2 instance in AWS. It includes instructions for creating an EC2 instance, connecting to it via SSH, installing Nginx, accessing the server, and changing the default page. Finally, it advises on exiting and terminating the instance after use.

Uploaded by

Andrew
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

AWS Nginx Server Setup, access it and change it’s default page in

Linux EC2 Instance


Full YouTube Video Here: https://youtu.be/casCo-d872I

Step 1: Creating a Linux EC2 Instance


• Login into AWS Console, Select the Region in which you want to work

• Navigate to Services, click on it, Select Compute section in it, Navigate to EC2 in it and click on
it
• You will re-directed to EC2 Dashboard, you can see launch instance button on the dashboard,
click on it

• Give a name to your instance, choose AMI image as Linux os, keep instance type and
architecture as default
• Create a key pair, select that key pair
• In network settings, click on edit, rename security group name, leave others for now we’ll see
it later
• Click on launch instance
• Wait for some time for instance to be created and running stage, your instance is created
Step 2: Connecting to the internet
❖ After instance starts running, click on connect at top, in “EC2 Instance connect” do not do
anything and click on connect, you’ll be connected to the internet with your instance.
Step 3: Connecting to local system using ssh client
❖ Go back to instance click on connect, this time go for ssh client

❖ Then open PowerShell, go to the directory where you downloaded key-pair file which is a
.pem file (ex: Linux.pem)
❖ Now copy paste the ssh client address link in powershell
❖ Type “yes”, then your connection will be established, type sudo su for checking if root user
comes up then you have successfully connected.
Step 4: Installing and Accessing Nginx Server
• All you have to do is type these commands in order
• Sudo su
• sudo yum update -y
• sudo yum install nginx -y
• sudo systemctl start nginx
• sudo systemctl enable nginx
• now you can go and enter your public ip address of the instance and see that nginx server
page is accessible and working, that same ip address can be used anywhere by anyone if they
want and as long as instance is running then we can access that page.
• If the page is not loading that means we have not enabled http or https networks, go back to
your instance
• Click on security group, click on the security group link, click on inbound rules
• Here you need to add http and https networks and ip address to anywhere
• Now you can access it

Step 5: Changing Nginx Server default page


• just need to change your current directory to nginx html page directory
• cd /usr/share/nginx/html
• sudo nano index.html

• using the sudo nano command you’ll be able to access nginx html page and you can do
changes there
• refresh the page now you can see the changes happening
Step 5: Exit and Terminate the instance
• exit by typing exit in the PowerShell or instance
• definitely terminate the instance

You might also like