0

I created subdomain in DirectAdmin using his admin panel. But I want to do the same from PHP. I have to add section to the httpd.conf and create folder in public_html folder. And then add to DNS. But I have to do using PHP or using DirectAdmin API? Because I don't know if there are any other places where I have to add information about my new subdomain. For example in this folder:

/usr/local/directadmin/data/users/admin/domains/mydomain.subdomains
Robert
  • 343
  • 1
  • 3
  • 14

1 Answers1

0

I dont know whatyou want to add to the DNS but da will create your a record. If you want to add more DNS records you can use the API.

CMD_API_DNS_ADMIN?action=edit&domain=domain.com&type=A&arecs0=name%3Dmail%26value%3D1.2.3.4&name=mail&value=1.2.3.5

To create files or directorys you can use the hools system. All hooks, i.e. custom scripts should be placed under /usr/local/directadmin/scripts/custom/.

you will need to create desired scripts first, then set correct permissions, and populate them with a needed content. Directory: /usr/local/directadmin/scripts/custom/ Permissions: 700 Ownership: diradmin:diradmin

I geuss you can use subdomain_create_pre.sh

Wouter
  • 809
  • 7
  • 19