Today I tried creating a small server in AWS and accessed it from my browser. It’s actually very simple.
First, I went to AWS and opened EC2. Then I clicked “Launch Instance”. I gave it a name, selected Amazon Linux, and chose a small free-tier instance.
Next, I created a key pair (this is important for login) and downloaded it. Then in network settings, I allowed HTTP (port 80) so I can access the website from outside.
After that, I launched the instance.
Once it started running, I connected to it using SSH. After logging in, I installed a web server using this
Once it started running, I connected to it using SSH. After logging in, I installed a web server using this command:
sudo yum install httpd -y
Then I started the server:
sudo systemctl start httpd
I also enabled it so it runs always:
sudo systemctl enable httpd
Then I created a simple webpage:
echo "Hello from my EC2 server" | sudo tee /var/www/html/index.html
Top comments (0)