Domain linking to "Index Of" page instead of website

Hello I’m new to VirtualMin/Webmin.

I have created a virtual server as followed on one of VirtualMin’s YouTube videos and completed the steps to upload my website files to the public_html folder.

When I click Preview website in VirtualMin the website loads fine in the browser… however when I enter my domain name “domain-example.com” it links to an “Index Of” page instead.

Could anyone please assist me here. Thanks.

Apparently the document root in the Apache config file was linked to a different directory so I just edited to link to the public_html folder instead and voila it works!

I have had this happen in virtualmin…i dont understand why it seems to be an issue that is ongoing with others too from time to time? Does cpanel ever have this problem?