How to connect a domain with ec2 inside subfolder

Hi,
I have a domain (files) inside a ec2 sub folder, I have created a virtual host file as well. which looks like one below

<VirtualHost *:80>
    ServerAdmin chcha.ji@gmail.com
    DocumentRoot /var/www/html/mrhero
    ServerName mrhero.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin chcha.ji@gmail.com
    DocumentRoot /var/www/html/brucelee
    ServerName brucelee.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

On the registrant side I have entered cloudflare dns where in cloudflare the cname is set to something like this
ec2-24-14-14-229.ap-southeast-1.compute.amazonaws.com

but on opening the domain it does not show the site inside the folder rather it shows the site which is openly lying on in the html root folder.
Please help.

I am unable to open brucelee.com instead mrhero.com is opening. (imaginary names)

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.