API doc_root of domain

trimpass

Verified User
Joined
May 11, 2017
Messages
18
Hello,

Can any one suggest how to get document_root of a domain using API command?

Thanks in advance.
 
Hello,

Directadmin does not have a feature to modify DOCROOT per domain hence there is no document root variable in domain's configs. That's why there is no API interface to get it. Document root is built in Apache/NGINX templates (by Directadmin):

Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
and
Code:
|?DOCROOT=`HOME`/domains/`DOMAIN`/private_html|

and for subdomains:
Code:
/|SUB|
is added later.

If you still need to get it via API then you could probably use "API command for running abitrary shell commands as the user - CMD_API_EXEC" to get it from

/usr/local/directadmin/data/users/userbob/nginx.conf
/usr/local/directadmin/data/users/a10001/httpd.conf

You will need to use a wrapper or sudo to read those files, as they are not readable by regular hosting users.

Related:

- https://www.directadmin.com/features.php?id=657
 
Back
Top