Create instnce and show something on server
1. Create key pair: under keypair section
2. create security group :- add inbound one rule as 22 port with ssh my ip and second rule http with anywhere and outbound with http and https with anywhere ip address
3. instances : create instance with t2.micro instance and select that security group
4. now click on your instance and inside that you will see connect button on yop. click on connect to connect to that instance. You will see option like connect using SSH key. In ubuntu machin use command given in connect section to connect with instance
5. install apache so that we can run html code
sudo yum -y install httpd mod_ssl
sudo systemctl start httpd
<HTML>
<H1> AWS ec2 instance</H1>
</br>
<p> Hi this is first instance created by <strong> Prakash Karena </strong></p>
</HTML>
:wq! save
:qa! quite
sudo /sbin/chkconfig httpd on
That's it now try to access your instance public IP on browser and you will see your html web page.
Make sure you are using http instead of https in your public IP to view your page. Otherwise page will not get load.
Tags:
webdevelopment