CA 19 - Create a simple EC2 instance and run a webserver and access it from outside.
Things To do in EC2 AWS
1. Open EC2 from aws and launch instance with server name and type
2.Create a key pair and download it after done
3. Add inbound rules by adding type HTTP(port-80) and SSH(port-22) with source 0.0.0.0/0
4.Launch instance
5.Get the public ipv4 address
Things To do in Command Prompt
1.Go to the key pair location in cp
2.icacls mykey.pem /inheritance:r(Read the key)
icacls mykey.pem /grant:r %username%:R(give permission to the specified User)
3.ssh -i mykey.pem ec2-user@3.236.29.1(Login)
4. sudo yum update -y
sudo yum install httpd -y(setup webserver in ec2)
5.sudo systemctl start httpd (start web server)
sudo systemctl enable httpd(autostart after reboot )
6.echo "Hi myself Adharsh and this is my webpage" |
sudo tee /var/www/html/index.html
7.sudo systemctl status httpd(status check for server)
Comments
Post a Comment