0

I use directadmin.

I need to have a subdomain with shop name, that point to web directory.

I use below code in this option: admin > Custom Httpd Configurations

|*if SUB="shop"|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/web|
|*endif|

But this is output code:

DocumentRoot /home/example/domains/example.com/public_html/web/shop

This is because in the sub host template file (/usr/local/directadmin/data/templates/virtual_host2_sub.conf) wrote this: DocumentRoot |DOCROOT|/|SUB|

I need to this correction output:

DocumentRoot /home/example/domains/example.com/public_html/web

How can I resolve this problem?

Nabi K.A.Z.
  • 9,887
  • 6
  • 59
  • 81

2 Answers2

0

I guess you already resolved the problem, anyway maybe this helps somebody else. I found this, it basically says that you should copy virtual_host2_sub.conf and virtual_host2_secure_sub.conf files from:

/usr/local/directadmin/data/templates/

to

/usr/local/directadmin/data/templates/custom/

Then, you should edit your custom files, changing the following lines:

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|

to

|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/`SUB`|

Then:

|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/`SUB`/cgi-bin/|

to

|?CGI=ScriptAlias /cgi-bin/ `DOCROOT`/cgi-bin/|

and

DocumentRoot |DOCROOT|/|SUB|

to

DocumentRoot |DOCROOT|
Choma
  • 708
  • 12
  • 24
0

With access level "Admin" choose from menu GUI "Server manager" -> Custom HTTPD configurations" -> choose your domain -> in the top right corner click "Customize".

In the first textarea add this:

|*if SUB="mysubdomain"|
|?SDOCROOT=`HOME`/domains/`DOMAIN`/public_html/`SUB`/public|
|*endif|

Simply change the path "public" if you wish. Aftewards check "/usr/local/directadmin/data/users/admin/httpd.conf" if everything's OK and "service httpd restart" (I think DA doesn't restart httpd after you save your custom configuration).

This works from 1.59.5 version