Short answer: Since DirectAdmin 1.710, |DOCROOT| is the document-root token for domains and subdomains. |SDOCROOT| still works, but |REALDOCROOT| and |PUB_DOCROOT| were removed and are now left in the config as literal text. On Apache that produced only a warning and a 404 for the affected virtual host, not a failed start. Find leftovers with grep -nE '\|[A-Z_]+\|' on the generated httpd.conf files, replace the old tokens with |DOCROOT| in your custom templates, and rewrite one user first. (Reviewed October 2026.)
In short: Since DirectAdmin 1.710, |DOCROOT| is the document-root token for domains and subdomains. |SDOCROOT| still works, but |REALDOCROOT| and |PUB_DOCROOT| were removed and are now left in the con…
DirectAdmin 1.710 simplified the document-root tokens (the DirectAdmin DOCROOT token change) in the web server templates and, in the same release, stopped giving subdomains an automatic www. alias. Stock templates were updated for you. Custom templates and custom HTTPD entries were not. We rendered each old token through a custom template on a DirectAdmin 1.712 test server and recorded exactly what Apache received.
Table of Contents
- What changed
- What each old token renders on 1.712
- Find affected templates and entries
- Fix the templates
- Rewrite one user, then everyone
- Also check hooks, plugins and private_html
- Verify
- How we tested
- Frequently asked questions
What changed
The DirectAdmin 1.710 changelog lists three token changes and one behaviour change:
-
|DOCROOT|is now used for both domains and subdomains. Subdomain templates previously used a different token. -
|SDOCROOT|is still available. -
|REALDOCROOT|and|PUB_DOCROOT|are removed completely. - Subdomains no longer get an automatic
www.sub.example.comalias. That is covered separately in www.sub.example.com not working after 1.710.
What each old token renders on 1.712
| Token in a custom template | What ended up in httpd.conf | Effect |
|---|---|---|
| ` | DOCROOT | ` |
| ` | SDOCROOT | ` |
| ` | REALDOCROOT | ` |
| ` | PUB_DOCROOT | ` |
So a broken template does not stop Apache. It quietly breaks only the virtual hosts built from that template. In our test the HTTP subdomain returned 404 while its HTTPS version, built from a different template, kept working, which is exactly the kind of fault that goes unnoticed for days.
Find affected templates and entries
Custom virtual host templates live in /usr/local/directadmin/data/templates/custom/; per-domain custom HTTPD and nginx entries are stored next to each domain’s config. Search both for the removed tokens:
grep -rnE 'REALDOCROOT|PUB_DOCROOT|SDOCROOT' /usr/local/directadmin/data/templates/custom/ 2>/dev/null
grep -lE 'REALDOCROOT|PUB_DOCROOT|SDOCROOT' /usr/local/directadmin/data/users/*/domains/*.cust_* 2>/dev/null
Then check the generated configs for any token that was not replaced. On a clean server this prints nothing; the stock 1.712 templates only contain |DOCROOT|.
grep -nE '\|[A-Z_]+\|' /usr/local/directadmin/data/users/*/httpd.conf
grep -nE '\|[A-Z_]+\|' /usr/local/directadmin/data/users/*/nginx.conf 2>/dev/null
Fix the templates
Copy each custom template aside, compare it with the current stock template, and replace the removed tokens. The sed line only runs if the backup copy was written; diff exits 1 when the files differ, which is normal here, and 2 only for an error such as a missing file:
cd /usr/local/directadmin/data/templates
f=virtual_host2_sub.conf; b=$(mktemp /root/$f.bak-$(date +%F).XXXXXX); echo "backup: $b"
diff -u $f custom/$f; echo "diff exit $? (0 same, 1 different, 2 error)"
cp -a custom/$f $b && cmp -s custom/$f $b && \
sed -i 's/|REALDOCROOT|/|DOCROOT|/g; s/|PUB_DOCROOT|/|DOCROOT|/g' custom/$f || echo "backup failed, template not changed"
grep -nE 'REALDOCROOT|PUB_DOCROOT' custom/$f || echo "no removed tokens left"
Leave |SDOCROOT| alone only if you depend on it meaning “the standard path even when a custom document root is set”; otherwise change it to |DOCROOT| as well, so there is one token to reason about. If the diff shows that the stock template now does everything your custom copy was for, delete the custom copy instead: every custom template is one more file to check at the next template change.
Rewrite one user, then everyone
Rewrite a single user first. The task regenerates only that user’s config and queues a graceful Apache reload, which ran about a minute later on our server; check the result before it does:
da taskq --run "action=rewrite&value=httpd&user=USER"
grep -nE '\|[A-Z_]+\|' /usr/local/directadmin/data/users/USER/httpd.conf || echo "no tokens left"
httpd -t && systemctl reload httpd
Each run writes a new backup file, so running the block twice keeps the original copy; note the path printed after backup:. To undo, copy that file back and rewrite the same way:
cp -a /root/virtual_host2_sub.conf.bak-YYYY-MM-DD.XXXXXX /usr/local/directadmin/data/templates/custom/virtual_host2_sub.conf
da taskq --run "action=rewrite&value=httpd&user=USER" && httpd -t && systemctl reload httpd
httpd -t checks the whole Apache configuration, including every user’s include file; there is no reliable way to check one user’s file on its own. When the user is clean, rewrite all configs. This restarts Apache (2.8 seconds on our server):
da build rewrite_confs
Also check hooks, plugins and private_html
Scripts in /usr/local/directadmin/scripts/custom/ and third-party plugins sometimes build paths themselves. Look for the removed tokens and for hard-coded private_html paths: DirectAdmin 1.711 stopped creating private_html, and none of the domains created on our 1.712 server had one.
grep -rlnE 'REALDOCROOT|PUB_DOCROOT|private_html' /usr/local/directadmin/scripts/custom/ /usr/local/directadmin/plugins/*/ 2>/dev/null
Verify
grep -A3 'ServerName sub.example.com' /usr/local/directadmin/data/users/USER/httpd.conf | grep DocumentRoot
curl -s -o /dev/null -w '%{http_code}\n' http://sub.example.com/
curl -s -o /dev/null -w '%{http_code}\n' https://sub.example.com/
Check HTTP and HTTPS separately, because they are built from different templates. Every DocumentRoot line should be a real path and both requests should return the site’s normal status code. To move a domain to a different folder on purpose, see custom document root for one domain.
How we tested
- Server: DirectAdmin 1.712 on AlmaLinux 9.8 with Apache 2.4 (CustomBuild), 19–20 October 2026.
- A custom
virtual_host2_sub.confwith its DocumentRoot set to each old token in turn, rendered with a per-user rewrite and checked withhttpd -t, the generated httpd.conf and HTTP/HTTPS requests; the same tokens printed from a custom HTTPD entry for a domain, its subdomain and an alias pointer. - 21 October 2026: the backup, diff, token replacement, rewrite and undo commands above re-run as published against a custom template containing
|REALDOCROOT|, including running the edit block twice: the first backup still held the original template. - Not tested: nginx, OpenLiteSpeed and LiteSpeed templates (DirectAdmin’s changelog applies the change to all of them), and servers upgraded from versions before 1.710.
DirectAdmin DOCROOT token at a glance
DirectAdmin DOCROOT token change: the questions this guide answers.
Official documentation: DirectAdmin documentation, Linux man pages.
Related guides: Using the da CLI: da update, da build, da config-set, da user and update channels · DirectAdmin removed legacy API endpoints in 2025–2026: what they were and their /api/ replacements · Installing DirectAdmin on AlmaLinux 9/10 and Debian 13 (modern license, web installer vs CLI).
Originally published on srvScripts — tested how-to guides and free tools for people who run servers.


Top comments (0)