Virtual Hosts not working for additional domains

April 8, 2015 2.3k views
Apache Getting Started DNS Ubuntu

I am running Virtualmin on Ubuntu 14.04 droplet. I have a domain bought from amazon route53 and all DNS work is left to it. I am not using digitalocean or Virtualmin's DNS features.

Ok, so the problem is, when I use the parent domain on my droplet, it works fine, but when I create a subdomain on Route53 and point it to the same IP address the parent domain has, and then create a virtual host on droplet, it does not work.

I have tested DNS settings through 3rd party tools, and seems like it is properly resolving to the given IP. On the server, when I try to access it gives "Server Not Found" error.

When I check the host via internal URL, , it works and shows the index file.

What am I doing wrong here?

  • What is the content of the virtualhost configuration being written in /etc/apache2/sites-enabled/ when you create your new virtualhost?

  • This is vhost file for main domain. and this is for subdomain:

    By the way, don't know what I did to the configuration, accessing either way now shows 403 Forbidden "You don't have permission to access / on this server." error.

    Can you please guide me what was the reasons for this error, and what was happening behind the scene when the hosts were creating problems as mentioned in my question above. Thanks

  • Ok, I have removed the 403 error. It was because the directory listing was prevented. But what was the reason of previous problem? I am pretty sure it will create problem on my next droplet too.

Be the first one to answer this question.