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

ERR_EMPTY_RESPONSE 500

Questions regarding the API
Application Programming Interface
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
mirek001
Posts: 1
Joined: Tue Apr 17, 2018 9:27 pm

Os: CentOS 6x
Web: apache + nginx
ERR_EMPTY_RESPONSE 500
  • Quote

Post by mirek001 » Tue Apr 17, 2018 9:52 pm

Hello,
i have 2 files, first:
http://centos.dnd.zone/adddomain.php

Code: Select all

<?php

// Server credentials
$vst_hostname = 'localhost';
$vst_username = 'admin';
$vst_password = 'mysecretpass';
$vst_returncode = 'yes';
$vst_command = 'v-add-domain';

// New Domain
$username = '12345678'; // << pass: qwe123
$domain = '12345678.com';

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

// Send POST query via cURL
$postdata = http_build_query($postvars);
$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);
$answer = curl_exec($curl);

// Check result
if($answer == 0) {
    echo "Domain has been successfuly created\n";
} else {
    echo "Query returned error code: " .$answer. "\n";
}
?>
and second:
http://centos.dnd.zone/rmdomain.php

Code: Select all

<?php

// Server credentials
$vst_hostname = 'localhost';
$vst_username = 'admin';
$vst_password = 'mysecretpass';
$vst_returncode = 'yes';
$vst_command = 'v-delete-domain';

// Delete Domain
$username = '12345678'; // << pass: qwe123
$domain = '12345678.com';

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

// Send POST query via cURL
$postdata = http_build_query($postvars);
$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);
$answer = curl_exec($curl);

// Check result
if($answer == 0) {
    echo "Domain has been successfuly deleted\n";
} else {
    echo "Query returned error code: " .$answer. "\n";
}
?>
First file adddomain.php get error 4 becouse try to create domain two times and I don't have idea how fix this. But works fine, domain was created.

Second file rmdomain.php get "This page isn’t working centos.dnd.zone didn’t send any data. ERR_EMPTY_RESPONSE 500". But works fine, domain was deleted, only 500 error in browser.
I try to run this on different computer and different operating system, clean cache and many else...
I installed vestacp on clean debian, ubuntu and centos install and the same errors.
I try install vestacp on my computer, on kvm, on VPS server and the same...

Please help me ;/
Top

Johnlumsden
Posts: 2
Joined: Sat Jan 27, 2018 9:45 am

Os: CentOS 4x
Web: apache + nginx
Re: ERR_EMPTY_RESPONSE 500
  • Quote

Post by Johnlumsden » Thu May 17, 2018 6:06 am

mirek001 wrote: ↑
Tue Apr 17, 2018 9:52 pm
Hello,
i have 2 files, first:
http://centos.dnd.zone/adddomain.php

Code: Select all

<?php

// Server credentials
$vst_hostname = 'localhost';
$vst_username = 'admin';
$vst_password = 'mysecretpass';
$vst_returncode = 'yes';
$vst_command = 'v-add-domain';

// New Domain
$username = '12345678'; // << pass: qwe123
$domain = '12345678.com';

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

// Send POST query via cURL
$postdata = http_build_query($postvars);
$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);
$answer = curl_exec($curl);

// Check result
if($answer == 0) {
    echo "Domain has been successfuly created\n";
} else {
    echo "Query returned error code: " .$answer. "\n";
}
?>
and second:
http://centos.dnd.zone/rmdomain.php

Code: Select all

<?php

// Server credentials
$vst_hostname = 'localhost';
$vst_username = 'admin';
$vst_password = 'mysecretpass';
$vst_returncode = 'yes';
$vst_command = 'v-delete-domain';

// Delete Domain
$username = '12345678'; // << pass: qwe123
$domain = '12345678.com';

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

// Send POST query via cURL
$postdata = http_build_query($postvars);
$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);
$answer = curl_exec($curl);

// Check result
if($answer == 0) {
    echo "Domain has been successfuly deleted\n";
} else {
    echo "Query returned error code: " .$answer. "\n";
}
?>
First file adddomain.php get error 4 becouse try to create domain two times and I don't have idea how fix this. But works fine, domain was created.

Second file rmdomain.php get "This page isn’t working centos.dnd.zone didn’t send any data. ERR_EMPTY_RESPONSE 500". But works fine, domain was deleted, only 500 error in browser.
I try to run this on different computer and different operating system, clean cache and many else...
I installed vestacp on clean debian, ubuntu and centos install and the same errors.
I try install vestacp on my computer, on kvm, on VPS server and the same...

Please help me ;/
There are 2 ways to easy fix this.

1. Get the Junk Out

Sometimes you face that empty page in the browser because of several junk or unwanted files in your system. So it is essential to put them away and make your PC a clean place for files and programs. Just follow these points:

First, open the Command Prompt and for this press Windows key and X.
Then, a black box will appear on the screen where you are supposed to type cleanmgr and hit the enter key.
It will initiate the cleanup process for the system in which all the junk will be kept at bay, and after it’s done, you can check for that page again.

2. Make Use of Command Prompt and Flush the DNS

Press the combination of Windows key and R to get the run dialog box.
Here type cmd and press enter. Now you will see the Command prompt window.
Just copy and paste the following command and hit the enter key:
ipconfig /release

ipconfig /all

ipconfig /flushdns

ipconfig /renew

netsh int ip set dns

netsh winsock reset
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
 

 

cron

Login  •  Register

I forgot my password