AWS- Lab-host website on EC2 server with Apache Server

Lab – host website on EC2 server with Apache Server

EC2 > Select instance is running and get its IP address. For mine it is - 18.224.94.159

  • Open the putty.

  • Run the command sudo su to provide the privileges to the root device.

  • Run the command yum update ?y to update the EC2 instance.

  • Install the Apache server by using the command sudo yum -y install httpd

  • Start the server by using the command sudo service httpd start

  • Check the server Status by using: service httpd status

Create Webpages to Host

  • Move to the html directory by running the command cd /var/www/html.

  • Create index.html with below content
    [root@ip-172-31-46-128 html]# cat index.html
    <h1> Hello, SatyaCodes.com!! </h1>
    iam a EC2 Website
    
  • Create about.html with below content
      [root@ip-172-31-46-128 html]# cat about.html
      <h1>About me</h1>
      Iam satya Kaveti
    
  • Check Website by going :80 - <http://18.224.94.159/>