DEV Community

Mohammed Azim J
Mohammed Azim J

Posted on

CA 28 – Create a simple EC2 instance and run a webserver

This task was about creating a simple EC2 instance in AWS and running a web server and accessing it from the internet.

First i went to AWS EC2 dashboard and launched a new instance. I selected Amazon Linux and a small instance type . Then i created a key pair and downloaded it so i can connect to the server using SSH.

One important step here was security group , I allowed port 22 for SSH and port 80 for HTTP otherwise the website will not open from browser.

After the instance started I connected to it using SSH and installed a web server (apache/httpd). Then I started the web server service and created a simple HTML file in the web server folder.

After that I copied the public IP address of the EC2 instance and opened it in the browser. The webpage loaded, so that means the web server is accessible from outside.

So overall steps were: create EC2 -> allow ports -> connect using SSH -> install web server -> start service -> open public IP in browser.

Top comments (0)