Hi eveyone!
To create a simple EC2 instance and run a web server,
Steps to create a simple EC2 instance
For creating the instance, give a name and select Amazon Linux as the operating system.
Then we choose instance type as t2.micro.
After that,create a key pair which will be used to connect to the instance.
In network settings,allow SSH and HTTP so that we can connect and access the web server from outside.
After the launch instance, click connect.
then click SSH session manager,then Click Connect.
moved to the home directory using cd ~.
Then I created a simple HTML file using echo command and named it index.html.
After that I used nano index.html to open the file and wrote basic HTML code inside it and saved the file.
Then I copied the public IPv4 address and opened the website.
Finally, the webpage was displayed successfully
Conclusion
these are the steps I followed to create a simple EC2 instance and run a webserver and access it from outside.
Top comments (0)