【问题标题】:Cpanel api2 Zoneedit ErrorCpanel api2 Zoneedit 错误
【发布时间】:2014-03-05 15:43:36
【问题描述】:

我正在尝试使用 cpanel api2 修改其中一个 cpanel 帐户的区域文件。下面是我正在执行的代码。

$xmlapi = new xmlapi($ip);
$xmlapi->set_host("192.168.1.1");
$xmlapi->set_port("2087");
$xmlapi->set_protocol('https');
$xmlapi->password_auth($cpusername,$cpuserpwd);
$xmlapi->hash_auth("root",$root_hash);
#print_r ($xmlapi);
$xmlapi->set_output("json");
$xmlapi->set_debug(1);
$xmlapi->api2_query($cpaccount, "ZoneEdit", "add_zone_record" , array($domain, $subdomain, $type, $ipaddr, $ttl));

注释代码使用系统哈希进行身份验证。另一种使用密码认证。两种身份验证方法都出现相同的错误。

当我将用户 ID 和帐户设置为 root 时,我收到内部 500 错误:

内部服务器错误 500

无法在 /usr/local/cpanel/Whostmgr/XMLUI/cPanel.pm 第 82 行设置 uid。

如果我更改用户 ID 和区域文件所针对的帐户,我会收到以下消息:

{
  "cpanelresult":{
    "apiversion":2,
    "func":"add_zone_record",
    "data":[{
      "result":{
        "status":0,
        "statusmsg":"You do not have permission to read the zone for : "
      }
    }],
    "event":{
      "result":1
    },
    "module":"ZoneEdit"
  }
}

我不知道下一步该做什么。当我以非 root 帐户之一在命令行登录时,输入 root 密码后,我可以 su 到 root。

我们将不胜感激。

【问题讨论】:

    标签: cpanel


    【解决方案1】:

    关闭它。由于现场没有解决方案,最终编写了一个 php 脚本,通过适当的 SOA 序列号管理从头开始生成区域文件,并安排一个 cron 作业以 root 身份运行以替换区域文件并重新加载它。

    换一种说法,Cpanel 界面从来没有工作过,所以从头开始编写它。

    如果有人对最终的通用实现感到好奇,那就是我网站上的 smartDNS 功能,并在博客中进行了描述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多