Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (5.6k points)

I want to have 2 domains with few subdomains in AWS and want to run them on a single EC2 instance.

I have set up 3 hosted zone with the following configuration:

Hosted zone 1:

domain1.com

Type A

52.108.XX.YY

Hosted Zone 2

domain2.com

Type A

52.108.XX.YY

Hosted Zone 3

app.domain1.com

Type A

52.108.XX.YY

Here is my http.conf file in virtualHost tag,

<VirtualHost *:80>   

     ServerName domain1.com   

     DocumentRoot "/var/www/html/domain1"   

     ErrorLog "logs/domain1-error_log"  

     CustomLog "logs/domain1-access_log" common  

     </VirtualHost>

     <VirtualHost *:80>   

     ServerName domain2.com   

     DocumentRoot "/var/www/html/domain2"  

     ErrorLog "logs/domain2-error_log"  

     CustomLog "logs/domain2-access_log" common  

     </VirtualHost>

     <VirtualHost *:80>  

     ServerName app.domain1.com   

     DocumentRoot "/var/www/html/app"  

     ErrorLog "logs/app.domain1-error_log"  

     CustomLog "logs/app.domain1-access_log" common  

     </VirtualHost>

 But I can only see domain1 and domain2 and when I try to see the subdomain it is showing me the error. How to resolve it?

1 Answer

0 votes
by (12.4k points)

Here you should not have more than one hosted zone per domain, if you have more than one for a domain name delete it(the one you created for the subdomain).

Each Hosted Zone will have four records, Two will be created by default, and don't delete them and then create the following two records and there provide the IP address of instance or load balancers.

Now create the "http.conf file. Hope this works!

Want to become AWS Expert? Come & join AWS Certification.

Do watch the below video tutorial on Route53.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

+1 vote
1 answer

Browse Categories

...