0

I am completely new to AWS . I am working with a team who are sitting in some other location. They had created an EC2 instance with 3 folders inside the /var/www/html/ directory namely say A,B,C. They attached an Elastic IP to that instance. Now when the browser is hit with 3 different URLs the corresponding folders get pointed and corresponding index.php is hit.

a.domain.com  = Points to the folder A and opens index.php inside it
b.domain.com  = Points to the folder B and opens index.php inside it
c.domain.com  = Points to the folder C and opens index.php inside it
Just the Ip Address = Points to the folder A and opens index.php inside    
it - I don't have an idea how

As instructed i created a Snapshot and created an AMI and launched my own EC2 instance with that. I checked and changed my /etc/hosts file which something looks like this

 127.0.0.1   localhost localhost.localdomain
 #xx.x.x.xxx  A B C
 #xxx.xx.xx.xxx A B C
 xxx.xx.xx.xxx a.domain.com b.domain.com c.domain.com  # My private IP
 127.0.0.1  a.domain.com b.domain.com c.domain.com

 /etc/httpd/conf.d/vhost.conf :-

 <VirtualHost *:80>
 ServerName c.domain.com
 DocumentRoot /var/www/html/C
 ErrorDocument 404 /404-not-found.html
 LogLevel warn
    ErrorLog /etc/httpd/logs/c_log
    TransferLog /etc/httpd/logs/c_web_log
<Directory "/var/www/html/C">
        Options -Indexes +FollowSymLinks +Includes
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

Rest of the folders configured like the above.

 service httpd restart

I am not sure why the above configuration is not allowing me to open or to point to either folders or open any when i hit the customized URL as above. I am a complete newbie to AWS.

Megan Fox
  • 435
  • 2
  • 6
  • 20
  • How are you accessing your new instance — is it via IP address or Domain Name? If it is via Domain Name, did you modify the DNS Records (presumably in Route 53) to point to your _NEW_ instance instead of the one they originally created? – John Rotenstein Dec 24 '19 at 23:27
  • I am accessing it via ip address. But the team is accessing their instance with the renamed folders along with domain name. I checked Route53 and nothing is in there. I am not sure where else to look into. – Megan Fox Dec 30 '19 at 08:42
  • 1
    If you want the domain name to point to a different IP address, you will need to modify the DNS record (which is the configuration of the domain name). You'll need to find somebody who knows how/where the DNS records for the domain name are configured. – John Rotenstein Dec 30 '19 at 22:05

0 Answers0