direct admin api commmand for symlink (private_html to public_html)

iteospin

New member
Joined
Dec 5, 2017
Messages
4
Hi,

IN a PHP script I call DirectAdmin api to create a new domain. I set the parameters for it to activate PHP and SSL. Now I want to know also the command/parameter for setting the symlink (for redirecting the private_html folder to public_html) .

The same function can be achived also in the Direct Admin, by selecting the radio button:
"Use a symbolic link from private_html to public_html - allows for same data in http and https"

but I want it to activate via api (if it is possible).

Or, are there some other solutions, i.e. via .htaccess file - how ..?

Thank you and regards,

Tadej
 
symbolic link from private_html to public_html

Hello Tadej,

Check and see:

- private_html to public_html link by default (DEFAULT CHANGE since Version 1.52)
https://www.directadmin.com/features.php?id=2023

- I want all newly created domains to use a private_html link, pointing to public_html
https://help.directadmin.com/item.php?id=489

1.) We yesterday updated the Direct Admiin to the latest version ("Current Available Version 1.521000")
- now a newly created domain via Direct Adim API, doesn't by default enable the link from private_html to public_html.
- I cannot access the file "/usr/local/directadmin/data/templates/directadmin.conf" but only "/usr/local/directadmin/conf/directadmin.conf" which does not contain the parameter "default_private_html_link"...?
- (with the Direct Admin updated) Do I still have to create a custom script (as of https://help.directadmin.com/item.php?id=489[/QUOTE])..?

regards
 
New directadmin.conf option, where the internal default is:

Code:
default_private_html_link=0


You need to update it to

Code:
default_private_html_link=1

in /usr/local/directadmin/conf/directadmin.conf and restart directadmin.


Do I still have to create a custom script?


Per your needs...
 
Direct Admin api symlink

New directadmin.conf option, where the internal default is:

Code:
default_private_html_link=0


You need to update it to

Code:
default_private_html_link=1

in /usr/local/directadmin/conf/directadmin.conf and restart directadmin.




Per your needs...

----------------------------------------------------------------

Ok,

1.) The Direct Admin is updated to the latest version (version 1.521000)
2.) In the file "/usr/local/directadmin/conf/directadmin.conf" I added the parameter default_private_html_link=1
3.) I restarted the Direct Admin
4.) Now, after I create via PHP script via DirectAdmin API a new domain with SSL enabled, then in e.g. Fillezilla I cannot anymore
access the folder private_html (by clicking on it the selection instantly jumps on public_html), but, if I in the browser enter my address
https://subdomain.domain.com it actually displays the default index.html from the private_html (and not my index.php from public_html...)

...so to make it work correctly I still have to (in Direct Admin) manually select the radio button "Use a symbolic link from private_html to public_html - allows for same data in http and https"...

But I want to avoid this "manul step", i.e. I want to do it all via the php script and the DirectAdmin API.

regards

Tadej
 
symlink via DA api




Hello,

Regarding creating a symlink via php script and DirecTaDmin api:

I searched for a solution, but haven't find any - seems like the API currently does not provide such a solution,
so, for the symlink to be activated, I still have to go to the DirectAdmin web-portal and click the appropriate radio-button.


Thank you anyway and best regards

Tadej
 
Back
Top