Cmd_api_custom_httpd

michael

Verified User
Joined
Mar 9, 2010
Messages
7
Hi Guys,

I'm writing some scripts to automatically create and configure accounts on the server with email, database, dns, ftp, etc. This uses basically all API functions available and working quite good.

However, I can't seem to get the CMD_API_CUSTOM_HTTPD function working. This always returns the current config and never update it with the supplied value. It is also the only one without an 'action' or likewise parameter: http://www.directadmin.com/features.php?id=580

PHP:
array(
  config   => '# test',
  domain   => $Domain
)

How can I get this to work? The connection and command is correct since I receive the current configuration. So it is not a login problem.

I could also just 'hack' it into the "/usr/local/directadmin/data/users/username/domains/domain.com.cust_httpd" file. But I'm unsure how to get this acknowledged by Apache after changing the file.

Thanks!
Michael
 
Hello,

Run DA in debug mode, along with the "| grep string" option:
http://help.directadmin.com/item.php?id=293

Call the normal command through your browser, then do the same thing again with your script.

DA will spit out what's being passed.
The CMD_API_CUSTOM_HTTPD and CMD_CUSTOM_HTTPD will use the exact same variables, so you'll be able to see what you're missing vs the browser's submission.

John
 
I'm also stuck on the same problem. How can i add this: php_admin_flag allow_url_fopen ON with the API to the desired domain?
How to simple write?

Hope someone has an answer. Can't find it anywhere.
 
Hi,

Did you try to urlencode your value?
It has been some time ago since I had this issue, but in my code I only see this:
array(
config => urlencode($Config),
domain => $Domain,
)

Good luck.
 
Back
Top