How to Create Our Custom Web Server in Aws ?
Tags: aws, cloud, webserver, ec2
Published: 2022-07-09 07:26:09

- _Now In This Article We will Learn How to Create Our Own Web-Server Page By Writing Some Information In HTML Format In a Very Simple way_.

- First We will Create a One Ec-2 Instance or a Virtual Machine, inside that we Get a 2 IP's such as Public IP & Private IP 

- Public IP is For My Client or User .

- Private IP is For My Internal Communication .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aqu4n7d5e18mgtshbiqq.png)

- Now Click that Check Box And connect it

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0rrr6iyunv970e530be.png)

- Then go inside a SSH client and Copy that Example ssh -i "New-key-pair.pem" ec2-user@ec2-15-206-81-18.ap-south-1.compute.amazonaws.com

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/af5awsz7cpyadv6x422s.png)

- After that, Open Xshell Software Which is Mostly Used in Company and This Software is used to Connect My Public IP By Doing SSH (simple Secure Shell) then Paste in that Linux Terminal and Enter .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unm8w5wsuzo6eesmtgo7.png)

- Then They Ask a Key For Access, Then click on Accept and Save Then Click On Browse And Open file , after that You have to Provide Your Private Key select it and Open it, Then Ok

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ltddb6gawvqfio7f13e1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r7mtwr1y47mmpdqga38x.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n5jknwej9rl3skm3lfzn.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w97d6y9wvfeu79gb0we9.png)

- After Doing This Things Now Your Linux Remote machine will connected Succesfully .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzyfafazr87ccui69iiw.png)

- Now First You have to run one Cmd Sudo su - To become a root user .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t1di6tbcinb2jkuaw5yx.png) 

- Then You will have to install httpd Packages first and the cmd is ( yum install httpd -y ) .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybwbiu7mon1u77re4p2z.png)

- Now You Successfully Installed httpd package .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/45szl5qy4k5g4bmlhz7i.png)

- After Succefully installing httpd packages You need to start service .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ourdl7j7ioor2yncuh9a.png)

- After Starting The Service you have to open path of Apache Server  where the file is and the cmd is cd /var/www/html

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zia9r2jzj23xgrl7xtue.png)

- Now Copy the Public Ip and Paste Into The Browser, and You get Default Apache server .

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ljgyki4nl8djld6me7g.png)

- Now come to Linux terminal and run one cmd vi index.html 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xf0vwcr3mx838h0zhf3e.png)

Now You get Like Notepad in a vi editor page and enter some information such as given below,
``<html>
      <body bgcolor=pink>
      <h1> This is My Custom Web Server </h1>
      </body>
</html>``

and come out of The Page and cmd is   ``:wq!`` enter

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hw04edmjr75yy65n903f.png)

- In The last Refresh That Browsing Page and You get Your Custom Web page Through the same IP.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55lq5e5md0xbtnpvxvvm.png)
Congratulations You Create Your custom Web-Server !

Thank You for Reading this Blog . Like, share, And comment !