phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
I have more than 1 server and I want to run script that handle WHM Api from a server to another one.

Is it possible?

Actually I saw that the requests that I execute on the main server that hold the script works fine but they seem to don't work at all for the reseller account on another server.

All the users must have root privileges?

And if it is true, why WHM let me Setup a Remote Access Key even if I'm not logged as root?

Can you help me?

Thank You!
 

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
phoenixweb said:
I have more than 1 server and I want to run script that handle WHM Api from a server to another one.

Is it possible?
This is certainly possible using cPanel's PHP-based API - each function call requires a hostname. The PHP API is not really much more than a curl-based secure method of accessing certain features.

phoenixweb said:
Actually I saw that the requests that I execute on the main server that hold the script works fine but they seem to don't work at all for the reseller account on another server.
The server to which you're connecting makes no difference. The important thing is that the user and access hash you specify must match the server to which you're connecting. The chance of the access hash being the same on two servers, even for different users let alone the same user, is very very very very small.

Since you can't use the same access hash for more than one server, make sure you're specifying the correct access hash for the server to which you're connecting.

phoenixweb said:
All the users must have root privileges?

And if it is true, why WHM let me Setup a Remote Access Key even if I'm not logged as root?
Any user with access to WHM can create a remote access key, assuming they've been granted sufficient privileges.
 

phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
I found the problem

Thank you!

However I have already founded what's wrong why my configuration.

Across server remote connection NEEDS usessl = 1;

I have tried to set this to 1 but unfortunatly my server have CURL without SSL, so don't work at all.

HOWEVER NO ERROR WERE PRINTED WHILE I WAS DOING THIS!
THERE WAS JUST EMPTY RESULT! PLEASE UPDATE THE cpanelerror tracer!

I have already ask to my tech to recompile Apache with CURL+SSL enable.
After that I'm sure everything will work fine! :)

Thank you for your support!
 

webignition

Well-Known Member
Jan 22, 2005
1,880
0
166
The API is by no means server specific - the exact same method for performing actions on the server on which the script is running is also used for performing actions on a different server.

Therefore there is nothing special to consider when connecting to a different server.

Just make sure you are using the correct credentials (check the access hash carefully - the same one cannot be used on more than one server).
 

phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
webignition said:
The API is by no means server specific - the exact same method for performing actions on the server on which the script is running is also used for performing actions on a different server.

Therefore there is nothing special to consider when connecting to a different server.

Just make sure you are using the correct credentials (check the access hash carefully - the same one cannot be used on more than one server).

Thank you WebIgnition for you support, more further cause you are the only one that answer to me!
However i'm not so old to miss to copy and past the right access hash inside a mysql.

I think the problem is that I don't have full privilege on the other server (it is of a friend of mine and i have just reseller privilege on it and not root privilege). On my server (the main that run the script) I use a username that is in the root group.

If it's just this, i just have to wait the new server to know if i need the right privileges.
But if it's not... i don't know what going to change in the script.

:(
 

phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
Don't Want To Work!

Okey, i have a fresh server, I insert the configuration in the mysql of the new server, test... and nothing.

Could not connect to the server.
The script WORKS fine only on the main serer that hold the script.
At this point the problem could be a firewall settings? Ports? Other things?

I REALLY DO KNOW... but didn't work.
Please help me!
::confused: :confused: :confused:
 

mramos

Active Member
Dec 10, 2002
25
0
151
Hi

I have similar problem. Any sugestions?

Tks
 

phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
Hi

I have similar problem. Any sugestions?

Tks
Could be:

CURL library is missing
OpenSSL library is missing
PORT 2087 is open only to connect in, but not for use for connect out.

In this case ask to your datacenter to turn up the PORT 2087 (in/out data connection).
 

phoenixweb

Well-Known Member
Jun 3, 2004
70
0
156
cPanel Access Level
DataCenter Provider
Could be:

CURL library is missing
OpenSSL library is missing
PORT 2087 is open only to connect in, but not for use for connect out.

In this case ask to your datacenter to turn up the PORT 2087 (in/out data connection).
AH the explanation is:
It works on the server that own the code because it perform a local connection and the firewall permit this but don't allow to speak outside.