Subdomain DocumentRoot Problem

bkalyoncu

New member
Joined
Aug 31, 2020
Messages
4
Hello,

I am new in this job and I am still learning.
First I want to tell the problem. When I create a subdomain, its opening in the public_html/Sub but I want to make it like Domain/subdomains/Sub for all of the domains not only one of them.
As I read on the documantation and the topics.
I have to change the virtual_host2_secure_sub.conf and virtual_host2_sub.conf like below;

|CUSTOM1|
|?DOCROOT=`HOME`/domains/`DOMAIN`/subdomains|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/subdomains|


Its okey and I have changed both.
If I create a subdomain its create the folder in public_html/Sub but in the httpd.conf it tells it is in the Domain/subdomains/sub.
It is okey if I take the sub folder from public_html and put on the Domain/subdomain/sub.
Its working like that.

But why it is creating the folder in public_html, is there a solution for that?

And also if I read the README file on the templastes, it tells me, if I chane the documents in templates folder on the next update they will be overwriten and lost. I have to put a copy of them on the custom folder inside the template folder and change them in custom folder. But there is no custom folder. Should I create a custom folder or in the new version of the Directadmin it is no necessary?
 
I think maybe the location is hard coded but you can get around it using custom scripts in /usr/local/directadmin/scripts/custom. Read the README file.

subdomain_create_post.sh - Runs AFTER the subdomain is created.

You can have it create the directory after the subdomain is created and delete the one that is not needed.
 
My english is not very good becauase of that I will say what I understand.

I have to do the changes on virtual_host2 files and I have to make a script to move or delete and create folder in customs which the road that you gave right ?

If the user delete the sub domain ? Should I write another scritp ? Becauae the system doesnt delete the folder if it is not in public_html

I dont know the language which driectadmin use what is the script language have to be ? I know only php html js etc. web programming

And lastly should I make a custom folder inside the templates to save virtual_host2 files?
 
Yes you should have a script to delete the subdomain directory as well. The script will be a shell script. So google how to write linux shell scripts.

You should already have a custom directory for your template customizations. The instructions say that is the first thing you do, copy the original to custom.
 
Should I create a custom directory? Because there is no custom directory inside the templates folder.
 

Attachments

  • 2020-09-01_170155.jpg
    2020-09-01_170155.jpg
    170.7 KB · Views: 5
okey I make a custom directory inside the template folder but I cannot coppy the files in it. It is always empty. What is the problem?
 

Attachments

  • 2020-09-01_174801.jpg
    2020-09-01_174801.jpg
    214.6 KB · Views: 7
It looks like to me you are copying it over itself not into the custom directory. If you are in the custom directory you have to

Code:
cp ../virtual_host_secure_sub.conf ./
 
Back
Top