Apache does not read contents from /home/domainname.tld/public_html

Hi there!

How to force Apache to read contents only from /home/domainname.tld/public_html/ and not contents from /var/www/html?

Server info:

OS: CentOS Linux 7 x86_64
Virtualmin: latest version
Webmin: latest version
Web Server: Apache 2.4.6


I think you can select the default directory for the host in Virtualmin tab, select the preferred virtual domain and go to “Server Configuration/Website Options” and select YES in option “Default website for IP address?”, I that will do it!


Hi again,
I just remembered that there also is a setting in “Webmin/Servers/Apache Webserver” select “Default Server” in tab “Existing Virtual Hosts”, and in “Document Options” there is a selection for the “Document root directory”… maybe this was what you where looking for.


Would be fine if I change from /var/www/html to /home?

I think you need to enter the whole path to the virtual domain, like you wroth in #1

...read contents only from /home/domainname.tld/public_html/


Helpful answer