web:/index.html에서는 “webserver1”이, web2:/index.html에서는 “webserver2”가 보이도록 한다.

web

web2

공인 IP 확인

3.34.255.200

3.34.255.200

3.35.27.15

3.35.27.15

XShell 접속

web

  1. [ec2-user@ip-10-10-1-84 ~]$ sudo yum -y install httpd

  2. [ec2-user@ip-10-10-1-84 ~]$ sudo systemctl restart httpd [ec2-user@ip-10-10-1-84 ~]$ sudo systemctl enable httpd

  3. [ec2-user@ip-10-10-1-84 ~]$ sudo vi /var/www/html/index.html

    webserver
    
  4. [ec2-user@ip-10-10-1-84 ~]$ curl localhost

    [ec2-user@ip-10-10-1-84 ~]$ curl localhost
    webserver
    

web2

  1. [ec2-user@ip-10-10-11-162 ~]$ sudo yum -y install httpd

  2. [ec2-user@ip-10-10-11-162 ~]$ sudo systemctl restart httpd [ec2-user@ip-10-10-11-162 ~]$ sudo systemctl enable httpd

  3. [ec2-user@ip-10-10-11-162 ~]$ sudo vi /var/www/html/index.html

    webserver2
    
  4. [ec2-user@ip-10-10-11-162 ~]$ curl localhost

    [ec2-user@ip-10-10-11-162 ~]$ curl localhost
    webserver2