how to access my domain??

Hi~I have installed virtualmin. When I create a new Virtual Server such as “example.com” . I have also change my hosts file and add: “54.252.xxx.xxx example.com”. When I ssh to example@54.252.xxx.xxx and create a test.php(echo “test file for domain;”) file inside /home/example/public_html. I can successfully access example.com. But, when I access example.com/test.php, it show “The requested URL /test.php was not found on this server.”

Then I wonder do not go to my example.com. So, I add the test.php to /var/www/. When I access example.com/test.php, it show “test file for domain”.

So, do I miss config something with virtualmin or my server? It is a problem related to BIND?

Thank you.

From a newbie.

It’s likely that you are requesting a URL in your browser that different to what you used in Virtualmin and what Apache is configured to now. Then it’d serve the default vhost, which in your case happens to be the Apache default directory under /var/www (which you should NOT use by the way with Virtualmin).

Please verify the exact hostname in your URL, and the one in Apache’s vhost file for the virtual server (“Services -> Configure Website -> Edit Directives”, look for “ServerName” and “ServerAlias”).

BIND would have no influence here since you put the IP in your hosts file directly.