Virtualmin → Server Configuration → Website Options and then put the name of the directory (roundcube or whatever) in ‘Website documents sub-directory’
Virtualmin is a GUI for you and your clients to do things that can be done on normal servers.
If you and your clients are happy to edit config files manually (and are sharp enough to remember values, formats and can avoid typos 100% of the time) then you can do everything manually that Virtualmin can do for you via the GUI.
Having said that, I understood from your initial message that you already have a domain working normally with WordPress installed in its own directory, Roundcube installed in its own directory and wish to create sub-domains which will point to these. Based on this I showed you a screenshot of how you could use the Virtualmin GUI to configure roundcube.domain.tld to map to the roundcube directory.
If it as not your intent to point the subdomain to the directory then I do apologize for misunderstanding your question.
=======================
So if I have wordpress folder in public_html/wordpress
and roundcube in public_html/roundcube
when I open www.domain.tld it should directly open wordpress
and when I open roundcube.domain.tld it should directly open roundcube
how would that be done ?
I have done this on a server by myself but want to understand how I can do on virtualmin
I have activated the subdomain option in Create Virtual Server
but I don’t know how to change the root document path of this subdomain virtual server. And I think that if done in Virtualmin would do what I achieved on a standalone server
But why are you making this so difficult for yourself?
Either just install RoundCube directly on the subserver, or use Virtualmins documentation on changing webmail globally.
The article is old, but it still works perfectly.
Also in demo1, I point the document root to public_html/wordpress so that www.domain.tld (or demo1.indiax.com) renders the /wordpress directory. I do this via Virtualmin → Server Configuration → Website Options
And then I create a new virtual server demo2.indiax.com (in your case, roundcube.domain.tld) and use Virtualmin → Server Configuration → Edit Proxy Website thus:
Go back and uninstall Wordpress. Then go to reinstall it and pay attention. By default it will install it in a Wordpress directory. Right next to that is an option to install it at top level, which will put it directly into the public_html folder. That will make it to where when you go to your domain it goes straight to the Wordpress site without the “wordpress” in the address.
I know I can do that. But then if you have
wordpress
roundcube
xyz
you cannot install them in the public_html
on a standalone server without virtualmin you can install them in their respective folders like
/var/www/html/wordpress
/var/www/html/roundcube
and just configure their sites-available files in which you can set directives
Also I know what you are trying to telling me. And I know that. I don’t want to do it that way. it is not the correct way to be honest if you have set up servers from scratch by yourself with virtualmin
You run your Wordpress at top level because that’s your main page on the web. You run Roundcube to Roundcube. You don’t want to have people accessing webmail by simply visiting the domain name. Same applies to other things. Forum can go to a forum folder so the address ends with /forum.
The point is, whatever your main prescience is on the internet, be it a Wordpress blog or a Xenforo Forum, you install it at top level.
Everything else goes to it’s own subfolder appropriately. It’s been done that way since day one of the internet.
sorry to say on a build from scratch server it is not like that
you install in subfolders and you manage it using respective file in sites-available of nginx
then after configuring sites-available files of each, when you do
domain.tld or www.domain.tld it goes to wordpress
roundcube.domain.tld would go to roundcube
because with respective sites-available file you can change the root directive value pointing to respective subfolers
somehow I think no one in this forum before virtualmin ever did this on a raw server. I can show a real working demo if you all don’t know this approach
You are trying to reinvent the wheel when there is no need to.
To do it your way in Virtualmin just create a subdomain named for each item you want. It’s instant and automatic. Then install the given software at top level.
Going by your example, you have domain.tld. Install wordpress at top level. Then create a subdomain called roundcube.domain.tld. Install roundcube on that subserver at top level.
But the only thing you’re doing is putting the name before the domain instead of after. It’s ridiculous really to go through all of that for what amounts to no difference at all, but it is very simple to do in Virtualmin and it is all automatic no matter which way you want to do it.
You configure that any way you want. That’s why there’s an “edit email alias” menu in each domain and subdomain you create. You can add, subtract, or forward any email from any domain to the other.
Again, it’s all right there in Virtualmin. All you have to do is look.