17

Change document root for main domain via GUI from user level


M
Marek Miklewicz

It would be nice to have ability to change Document Root for main domain from user level, similarly like subdomain document root change. We have a lot of requests on our shared hosting to change DocumentRoot for user domain for example if he uses laravel and needs to change documentRoot from /home/user/domains/domain.com/public_html to /home/user/domains/domain.com/public_html/public.

A

Activity Newest / Oldest

Avatar

Roman Mazur

While developers are focusing on global things, like discarding some OS'es support / licensing types, I made own realisation for document_root on templates with custom_domain_items (feature).

Add to /usr/local/directadmin/data/admin/custom_domain_items.conf

customdocroot=type=listbox&api_only=no&hidden=no&string=|LANG_DOCROOT|&item1txt=/public_html&item1val=/&item2txt=/public_html/public&item2
val=/public&item3txt=/public_html/html&item3val=/html&item4txt=/public_html/htdocs&item4val=/htdocs&item5txt=/public_html/static&item5val=
/static&item6txt=/public_html/dev&item6val=/dev&item7txt=/public_html/stage&item7val=/stage&item8txt=/public_html/prod&item8val=/prod&item
9txt=/public_html/blog&item9val=/blog&item10txt=/public_html/wordpress&item10val=/wordpress&desc=|LANG_DOCROOT_DESC|&default=0

then modify /usr/local/directadmin/data/templates/custom/virtual_host2.conf and /usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf accordingly
In the beginning:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|*if CUSTOM_DOMAIN_ITEM_customdocroot|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html`CUSTOM_DOMAIN_ITEM_customdocroot`|
|*endif|
|*if CUSTOM_DOMAIN_ITEM_customdocroot="0"|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|*endif|
In VirtualHost section: replace DocumentRoot with
DocumentRoot |REALDOCROOT|

Congrats, yo've done it.


Avatar

Selim Koç

I did not want to add a new feature request, but the one I will write is similar. If we add a domain pointer, we don't have custom SSL options for the pointer domain. If we add a domain as a regular domain, we don't have control over the document root for that domain (for example I would like to add a domain with the same document root as the main domain but with custom SSL). So having the ability to change the document root for non-main domains, will solve our problem (setting it to be the same as the main domain). Alternatively, a domain pointer with a custom SSL certificate will also solve the problem. Currently, we solve the problem with manual work, but it could be better done via the DirectAdmin panel.


Avatar

Sabah Alkhadoka

I what to watch a moive


Avatar

Gedas

Status changed to: Planned

Avatar

Krystian Ż

It's the same with us too. Please add an option to change docroot for domains by users