Configure Webserver in AWS EC2 instance.
After launching an instance in aws. We can make it a webserver to launch websites or other things.
Launching EC2 instance using CLI
To configure any instance a webserver there are 3 steps to follow
1. Download the server software.
2. Configuring it in our system.
3. Starting the server.
Here we are using Linux instance so, the software will be httpd.
To install it type command
yum install httpd
After that type y to install it.
Now, It has been installed and to start the service, type
systemctl start httpd
systemctl enable httpd
Note- Here, the ipadress that is hosted is my public IP. Our instance has been started working as a server and client can view the files present in the folder /var/www/html by using url http://public-ip/filename.html.
For this we have to set our inbound rules in aws.
Now, lets make a html file.
![]() |
Go to the file |
![]() |
Use the vim editor to edit |
![]() |
Press i to type and type your code |
![]() |
Type :wq to save it |
Now to access this file use the url http://public-ip/filename.html
Thank You for reading.
I would like to thanks Vimal Daga Sir.
My Email — ayanchawlae@gmail.com
Comments
Post a Comment