Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Dev Section Scripting / API
  • Search

Error use "v-add-letsencrypt-domain" on my server

Questions regarding the API
Application Programming Interface
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
hongoctrien
Posts: 13
Joined: Sat Sep 30, 2017 3:17 am

Error use "v-add-letsencrypt-domain" on my server
  • Quote

Post by hongoctrien » Wed Mar 27, 2019 4:07 am

On my localhost, every ok (return 0 - success).

On centos server, I can't add letsencrypt with curl, return like the image

My script

Code: Select all

<?php

// Server credentials
$vst_hostname = 'xxxxxxx';
$vst_username = 'xx';
$vst_password = 'xx';
$vst_returncode = 'yes';
$vst_command = 'v-add-letsencrypt-domain';

// Prepare POST query
$postvars = array(
    'user' => $vst_username,
    'password' => $vst_password,
    'returncode' => $vst_returncode,
    'cmd' => $vst_command,
    'arg1' => $vst_username,
    'arg2' => 'phanhuuhien.aztest.vn'
);
$postdata = http_build_query($postvars);

// Send POST query via cURL
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
$return = curl_exec($curl);

// Check result
if($return == 0) {
    echo "ok";
} else {
    echo "no ok";
}
?>
Error image

Image

Please help me, thank you!
Top

hongoctrien
Posts: 13
Joined: Sat Sep 30, 2017 3:17 am

Re: Error use "v-add-letsencrypt-domain" on my server
  • Quote

Post by hongoctrien » Wed Jul 31, 2019 4:13 am

Please help!
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Scripting / API”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password