Page 1 of 1

ERR_EMPTY_RESPONSE 500

Posted: Tue Apr 17, 2018 9:52 pm
by mirek001
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 ;/

Re: ERR_EMPTY_RESPONSE 500

Posted: Thu May 17, 2018 6:06 am
by Johnlumsden
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