First of All you have to Login to AWS Console with root or admin policy user. And from Console Search EC2 Service.
- To create an EC-2 instance Click on Launch instance tab . Then type Name of your Server (ex-HTML_WebPage).
- Select Amezon Machine Image (AMI) to Ubuntu or Anything You Want. In this program I will select ubuntu. Select Instance Type You Want And give Key Pair. If you don’t have key pair simply Create new one save on your computer.
- Create Security Group & Allow HTTPS & HTTP Traffic From the internet with Default one . And If you want to increase storage configure it .
- And jump hit on Launch Instance. Then Go to instance And Select the Instance which we created now and Connect via EC2 Instance Connect click on Connect. Now You have Successfully Connected EC2 instance with Basic Configuration.
- Then You have New Tab open as a Terminal[CLI] In Browser login with username by default. So you have to Switch To Root for that type
sudo -sand hit Enter. Now You are root so you have to Update ang upgrade your instance by using
command. And update it.
apt-get update && apt-get upgrade
- When your machine is upgraded you have to install a apache2 server. Apache is a popular open-source, cross-platform web server that is, by the numbers, the most popular web server in existence. For Installing apache2 just type
and hit enter and then it prompt you to install yes or no. Just you have to type
apt-get install apache2
- Now your apache2 is install but not started. We have to start apache2 by typing the command
service apache2 start
- Now we have Default server so you have edit the HTTP servers index file. The file is stored in /var/www/html/ so you have go to that directory by using
cdcommand. And then check the index file is there or not by using
For welcome landing page we edit the index.html file by nano command i.e
nano index.htmland then edit your welcome landing page
(ex - Hello, Welcome to My New Web Server! 😊) .And save it.
Hey Congratulations We Have Created a Welcome Web Server using apache2. For checking your landing page type public-ip of instance (server) you created and paste on google and see the magic we created.
Note- You can Replace this index file with your code file and upload on server.