Custom DOCROOT for newly created domains only

rlahaise

Verified User
Joined
Jan 12, 2022
Messages
13
I got a situation were I would like to change the DOCROOT for all newly created domains and not touch the existing ones. In the past I have always used the Custom HTTPD Configurations with the GUI but if possible I would like to automate this process.

Preferred situation:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public|

I know you can adjust the virtual_host2*.conf templates but this will change it for all domains. I could also do something with a domain_create_(pre|post).sh script and just script it but I'm wondering if someone has a better idea, how would you tackle this issue?
 
|?DOCROOT=`HOME`/domains/`DOMAIN`/public|
Sorry but this sounds odd to me. If it's for newly created domains, why not use the default of public_html instead of public. Because public_html is widely used and almost a default, also very often presented in manuals to users. So why not use the default instead of making life difficult?

So better idea, put stuff to default and then you don't need scripts or custom stuff to get things done.

Shouldn't be difficult if the other user's home DOCROOTS are created manually via custom templates per account.

If you've done it via virtual_host2*.conf templates then it's indeed for al domains, I don't know then how to split those things.
 
You are absolutely right that it is an odd request and that it would be much better to just use the default public_html... But let's say that we have a bunch of applications that are poorly written and for the developers it would be easier if the docroot was changed for all future applications that must be migrated to this specific server.

So to be clear, the most obvious solution would be to tell the developers that they need to change their code and I have absolutely no problem with telling them that but I am also curious as to what kind of solution would be possible in this scenario; so that I can better improve my understanding of DirectAdmin.

Thank you for taking your time to give your input.
 
are poorly written and for the developers it would be easier
Developpers should stop creating poor written stuff then and to prevent this it's better to not make life easier for them. :) But I understand your issue and I'm glad you agree with these basics.

But as far as I know, and due to lack of other reply's I'm probably right, you can only do this manually per domain, as changing vhost would indeed change all vhosts, so all domains.
As far as I know, also in other panels there is no half way option, it's either everybody or setup manually per domain/account customisation.
 
Back
Top