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.