Remote.cgi and creating domain issue?

7 posts / 0 new
Last post
#1 Thu, 01/13/2011 - 07:02

Remote.cgi and creating domain issue?

I am attempting to take advantage of the remote API. When I attempt to create a non-existing domain it gives me that it exists for some reason.

why or what did I do wrong? here is the url to create it:

https://localhost:10000/virtual-server/remote.cgi?program=create-domain& server for foo&unix&dir&webmin&web&dns&mail&limits-from-plan&json=1
Thu, 01/13/2011 - 09:49


Your syntax actually works for me... I logged into a test server, and ran this:

wget --no-check-certificate --http-user=root --http-passwd=password 'https://localhost:10000/virtual-server/remote.cgi?program=create-domain& server for foo&unix&dir&webmin&web&dns&mail&limits-from-plan'

It sits there for a few moments while creating the account... after which, I can go into Virtualmin and see "" in the UI.

So it actually does sound like it thinks that domain already exists on your system for some reason. It may have been there before and not been completely removed, for example. One thought would be to see if other domains work for you.


Thu, 01/13/2011 - 10:39

I am actually using the php curl module and from what I know there is no way it will cause it to run twice.

function callRPC() {
$url = "https://localhost:10000/virtual-server/remote.cgi?program=create-domain& server for foo&unix&dir&webmin&web&dns&mail&limits-from-plan&json=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_USERPWD, "root:rootisoverrated");
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
Thu, 01/13/2011 - 10:47

Sorry, I'm not sure what might cause that :-)

Your code seems correct. However, if it's somehow or another being called twice, that could cause the errors you're seeing.

It does seem to work when being called manually from the command line, so the next step would just be debugging the PHP and the browser is doing in order to determine what's causing the problem you're seeing.

You may want to review the access_log and error_log for that Virtual Server to see if that provides any insight.


Thu, 01/13/2011 - 11:12

hmm! I can try this method:

<?php read_file(''); ?>
Thu, 01/13/2011 - 12:54

did not work as I planned.

Thu, 01/12/2012 - 15:50

interested in similar solution. subscribing to track

Topic locked