Issue
I have a virtual private server running Debian with DirectAdmin.
I have edited the vhost template files used by DirectAdmin so that subdomains aren't placed in the main domain's public_html
. As per the instructions, I have asked DirectAdmin to rewrite the vhosts, which it did. After adjusting the directory structures, all sites work like a charm.
However, adding new domains builds the default directory structure and adding subdomains spits out an error.
Detailed description
Let me explain in detail. Here's the docroots my custom templates create.
virtual_host2.conf:
|?DOCROOT=`HOME`/domains/`DOMAIN`/www/public_html|
virtual_host2_sub.conf:
|?DOCROOT=`HOME`/domains/`DOMAIN`/`SUB`/public_html|
After creating the domain test.pl, I get the following (incorrect) directories:
/home/myuser/domains/test.pl/.htpasswd
/home/myuser/domains/test.pl/public_ftp
/home/myuser/domains/test.pl/public_html
and the vhost entry lists the following (correct) docroot:
DocumentRoot /home/myuser/domains/test.pl/www/public_html
Adding a subdomain works the same - old incorrect directory structure is created, but the vhost uses the new, correct template. After I correct the domain's directory structure:
/home/myuser/domains/test.pl/www/.htpasswd
/home/myuser/domains/test.pl/www/public_ftp
/home/myuser/domains/test.pl/www/public_html
I try to add a subdomain again. This result in 3 errors and a failure to create the subdomain:
Error creating /home/myuser/domains/test.pl/public_html/mysub
A directory component in /home/myuser/domains/test.pl/public_html/mysub does not exist or is a dangling symbolic link
Error creating /home/myuser/domains/test.pl/public_html/mysub/cgi-bin
A directory component in /home/myuser/domains/test.pl/public_html/mysub/cgi-bin does not exist or is a dangling symbolic link
Error creating /home/myuser/domains/test.pl/private_html/mysub
A directory component in /home/myuser/domains/test.pl/private_html/mysub does not exist or is a dangling symbolic link
Question
How to notify DirectAdmin of the new directory structure when creating domains and subdomains?