One domain multiple webroots

The does not make much sense but I could not find a better one for my request.

I have tried to succumb to a customers wish when creating a no virtual servers for a custom webshop.

My customer showed me an example of how they normaly creates a webshop, and I want to automate this with Virtualmin.

Creating a shop for foo.com.

ServerName shop.foo.com DocumentRoot /home/foo.com/frontend/docs AllowOverride All Options FollowSymlinksifOwnerMatch Order allow,deny Allow from all

This I can easily change by creating a new "server template" in virtualmin. But he also need a admin part of his shop.

Creating a shop for foo.com.

ServerName shop.foo.com DocumentRoot /home/foo.com/frontend/docs AllowOverride All Options FollowSymlinksifOwnerMatch Order allow,deny Allow from all ServerName shopadmin.foo.com DocumentRoot /home/foo.com/admin/docs AllowOverride All Options FollowSymlinksifOwnerMatch Order allow,deny Allow from all

Is it possible to do this with Virtualmin using the "server template" the "Users' website directory to create" option only allow me to create one directory. What would be the best way to creating this?

Status: 
Active

Comments

Howdy -- it sounds like you're asking if it's possible to automatically create a sub-domain for the admin section of the site whenever a domain is being created -- does that sound correct?

Yes that is what i am looking for.

As I re-read your initial request, it actually appears that you would need two Sub-Domains to be created along with the main Virtual Server.

Unfortunately, there isn't a simple way to do that within Virtualmin.

The best method I can think of would be to write a script to do what you're trying to do, and have that script be called whenever you create a new Virtual Server. You can have a script called when creating a new Virtual Server by going into System Settings -> Virtualmin Config -> Actions upon server and user creation, and there you can set "Command to run after making changes to a server".

After a lot of testing with the customer we found a solution that pleased the customer as well as my server config. They changed their code a bit soo that it fits virtualmin's sub-server structure.

I do have another request now with the same customer. They would really like for me to change the public_html folder to docs instead. that is no problem for the mainsite. but the sub-domains still use the public_html how do I change that?

Best

Sune Runnerz.

Just to clarify -- is it Sub-Servers that you are having a problem with?

And are you saying that you've updated the Server Templates for the top-level Virtual Servers, but that while that works, Sub-Servers are still using "public_html" for the DocumentRoot?

Yes it is the Sub-servers i have probelms with.

Here is what I did.

I clone the Template Default settings and name it "webshops" I then edit the Apache config to use docs instead of public_html

Creating a new main site foo.com everything is okay.

Now I want to create the subdomain shop.foo.com This then defaults to the "settings for sub-servers" template and that still creates the public_html.

If I clone the "settings for sub-servers" and try to edit the Apache part everything is empty.

Quick workaround for me right now is to change the setting in the default template. Then every thing seems to be working.

But I do want this to be seperate templates so how would I do that?