I do remember reading something somewhere in the documentation about recommending that the option to host sub-domains be disabled because of possible confusion of the end user, but I do use sub-domains and I'm the one confused.
I added example.com to Virtualmin, and then added wiki.example.com as a "sub-domain of example.com", not a "sub-server". I expected to see a path and skeleton files created at /home/example/domains/wiki.example.com/public_html, but there was no "public_html" directory. So I deleted the sub-domain in Virtualmin and re-added it, and the expected path was created, albeit with missing "icons" and "stats" directories, but with the two files in /etc/skel.
I then added content, and loaded the sub-domain in my browser, but I got the skeleton "index.html" page instead of what I expected. Thinking I must have forgotten to delete the skeleton index page, I went back and looked. It wasn't there.
After some poking around I ended up at Virtualmin | Server Configuration | Website Options for wiki.example.com and the "Website documents sub-directory" is /home/example/public_html/wiki (and there are skeleton files there too) instead of where I expected it to be at /home/example/domains/wiki.example.com/public_html.
There are three problems here:
- Virtualmin set up the same sub-domain two different ways on two different attempts. This doesn't make sense.
- Why is the document root at /home/example/public_html/wiki instead of /home/example/domains/wiki.example.com/public_html?
- I then tried to change the ""Website documents sub-directory" from /home/example/public_html/wiki to /home/example/domains/wiki.example.com/public_html, but I got this error: "Failed to save website options : Website documents sub-directory cannot start with or end with /". However, the default path begins with a forward slash (which only makes sense, seeing as it starts with "/home" off the root), and the path I entered started out in the identical manner and did not end with a forward slash.
I then went to Virtualmin | Services | Configure Website | Edit Directives. I started to configure Apache that way I expected it to be configured, but then I realised I was heading down a path where I was clearly acting against the will of Virtualmin (considering it has put a "wiki" sub-directory in other weird places too, like the "cgi-bin" directory), so I thought I'd better ask here first.
Considering Virtualmin seems to be undecided about the path to create for a sub-domain, which one is the correct one? If the correct one is /home/example/public_html/wiki, why? Why is it not /home/example/domains/wiki.example.com/public_html? And why can't I change it at Virtualmin | Server Configuration | Website Options?