Pages:
Author

Topic: webserver connecting to a VPS - page 3. (Read 2863 times)

sr. member
Activity: 344
Merit: 250
February 04, 2015, 01:53:59 PM
#9
Calling wallet under his name.
coind, for example, Bitcoin has bitcoind, Litecoin has litecoind

What you get if you type the command:
or
netcoind getinfo

What do you specified in the $ _GET ['w_host']

You mean the same coin?
https://github.com/netcoinproject/netcoin

Code:
$test=new jsonRPCClient('http://user:pass@your_ip_server:rpc_coin_port');

Netcoin RPC Port:  11311
hero member
Activity: 1008
Merit: 502
February 04, 2015, 01:37:00 PM
#8
I have 2 questions

First one,

 I installed the Netcoind in the root directory of the VPS, I have since moved the netcoin folder yet I think all the config and wallet info is still in the root directory would this block communications?

Second one, (if the directory situation is not the problem)

Is the program possibly by default somehow calling bitcoind and not netcoind and possibly by default sending a message

bitcoind getbalance

instead of

netcoind getbalance
hero member
Activity: 1008
Merit: 502
February 04, 2015, 01:24:33 PM
#7
Can you telnet from your server node to the bitcoind server on the ports that are open?  (Or do a scan from your web server to your bitcoind server to see if those ports are accessible externally?)

When you tried it from here:
http://www.canyouseeme.org

did it show they were open?




yes telnet connects

root@webserver hosting:~# telnet MY.VPS.IP.ADDY 11310
Trying MY.VPS.IP.ADDY...
Connected to MY.VPS.IP.ADDY.
Escape character is '^]'.
^]
telnet> q
Connection closed.



root@webserver hosting:~# telnet MY.VPS.IP.ADDY 11311
Trying MY.VPS.IP.ADDY...
Connected to MY.VPS.IP.ADDY.
Escape character is '^]'.
^]
telnet> q
Connection closed.

http://www.canyouseeme.org

does not let me change the IP address, I can change the port but not the IP address
hero member
Activity: 1008
Merit: 502
February 04, 2015, 01:21:16 PM
#6
Here is the error log from what I am getting
 
[04-Feb-2015 02:03:02 America/New_York] PHP Fatal error:  Uncaught exception 'Exception' with message 'Incorrect response id (request id: 1, response id: )' in /home/dicefort/public_html/netcoin/install/driver_test.php:68
 
Stack trace:
#0 /home/dicefort/public_html/netcoin/install/driver_test_call.php(12): jsonRPCClient->__call('getbalance', Array)
#1 /home/dicefort/public_html/netcoin/install/driver_test_call.php(12): jsonRPCClient->getbalance()
#2 {main}
  thrown in /home/dicefort/public_html/netcoin/install/driver_test.php on line 68
_______________________________________________________________________________ __________
the whole /driver_test_call.php file (Line 12 is in red I deleted a lot of lines that were spaces to shorten the code Smiley
 
/*
 *  © BitcoinDice
*/
include 'driver_test.php';
$test=new jsonRPCClient('http://'.$_GET['w_user'].':'.$_GET['w_pass'].'@'.$_GET['w_host'].':'.$_GET['w_port'].'/');
@$test_call=$test->getbalance();
echo json_encode(array('result'=>$test_call));
?>
_______________________________________________________________________________ __________
 
driver_test.php (Line 68 is in red)
 
/*
 *  © BitcoinDice
*/
class jsonRPCClient {
private $debug;
private $url;
private $id;
private $notification = false;
public function __construct($url,$debug = false) {
$this->url = $url;
empty($proxy) ? $this->proxy = '' : $this->proxy = $proxy;
empty($debug) ? $this->debug = false : $this->debug = true;
$this->id = 1;
}
public function setRPCNotification($notification) {
empty($notification) ?
$this->notification = false
:
$this->notification = true;
}
public function __call($method,$params) {
if (!is_scalar($method)) {
throw new Exception('Method name has no scalar value');
}
if (is_array($params)) {
$params = array_values($params);
} else {
throw new Exception('Params must be given as array');
}
if ($this->notification) {
$currentId = NULL;
} else {
$currentId = $this->id;
}
$request = array(
'method' => $method,
'params' => $params,
'id' => $currentId
);
$request = json_encode($request);
$this->debug && $this->debug.='***** Request *****'."\n".$request."\n".'***** End Of request *****'."\n\n";
$opts = array ('http' => array (
'method'  => 'POST',
'header'  => 'Content-type: application/json',
'content' => $request
));
$context  = stream_context_create($opts);
if ($fp = fopen($this->url, 'r', false, $context)) {
$response = '';
while($row = fgets($fp)) {
$response.= trim($row)."\n";
}
$this->debug && $this->debug.='***** Server response *****'."\n".$response.'***** End of server response *****'."\n";
$response = json_decode($response,true);
} else {
throw new Exception('Unable to connect to '.$this->url);
}
if ($this->debug) {
echo nl2br($debug);
}
if (!$this->notification) {
if ($response['id'] != $currentId) {
throw new Exception('Incorrect response id (request id: '.$currentId.', response id: '.$response['id'].')');
}
if (!is_null($response['error'])) {
throw new Exception('Request error: '.$response['error']);
}
return $response['result'];
} else {
return true;
}
}
}
?>
legendary
Activity: 4214
Merit: 1313
February 04, 2015, 12:44:28 PM
#5
Can you telnet from your server node to the bitcoind server on the ports that are open?  (Or do a scan from your web server to your bitcoind server to see if those ports are accessible externally?)

When you tried it from here:
http://www.canyouseeme.org

did it show they were open?


hero member
Activity: 1008
Merit: 502
February 04, 2015, 12:36:57 PM
#4
the webserver side only needs the rpc and vps ip stuff not the vps login info. type into google "can you see me" and look for a port testing tool to see if the port your using is open or not. this looks like an issue with the firewall on the vps

I did this with the
sudo netstat -plunt

it says netcoind is listening on 11310 and 11311 on tcp6 and 11310 on tcp
hero member
Activity: 1008
Merit: 502
February 04, 2015, 12:28:51 PM
#3
the webserver side only needs the rpc and vps ip stuff not the vps login info. type into google "can you see me" and look for a port testing tool to see if the port your using is open or not. this looks like an issue with the firewall on the vps

I will have the techs at the company where they are both purchased look into that, They said all the ports associated with this program are open and ready for communications tho.  I do know when you tlel it to use the rpc port it takes a few seconds for the error to pop up, BUT if you use the port listed in th conf file it takes about 30 to 60 seconds before the error pops up.

I will try the port testing tool now than you sir. I will say when we first bought the VPS it cme under and atrocious attack over 10,000 failed logings in less than 24 hours so they installed CSF Firewall. But they were supposed to have whitelisted my IP and the webserver IPS form that.
legendary
Activity: 1540
Merit: 1002
February 02, 2015, 09:13:42 PM
#2
the webserver side only needs the rpc and vps ip stuff not the vps login info. type into google "can you see me" and look for a port testing tool to see if the port your using is open or not. this looks like an issue with the firewall on the vps
hero member
Activity: 1008
Merit: 502
February 02, 2015, 12:59:00 AM
#1
Hello I neeed some help, I have been working on this for a little over a week and just can not figure it out.

I have a wallet running on a VPS and I have a website on a webserver that needs to communicate with the wallet on the VPS.

No matter what i do the web server always gets an error "Cant connect to wallet. Make sure the info is correct and try again"

My wallet.conf

rpcuser=myusername
rpcpassword=my password
listen=1
daemon=1
server=1
rpcconnect=VPS IP
rpcconnect=Webserver IP
rpcconnect=Webserver secondary IP
rpcallowip=Webserver IP
rpcallowip=Webserver secondary IP
rpcallowip=VPS IP
rpcallowip=127.0.0.1
rpcport=11311
port=11310
addnode=63.246.129.56

Ok I said webserver secondary IP becasue the techs at the place where we bought the webserver and VPS (which is the same company) told me
"The actual connection ip will show up (secondary IP) not (Webserver IP) I think thats the error."
SO

Here is what the webserver is asking for.

Wallet info

Host:  Host
Login: Wallet User
Pass: Wallet Password
Port: port

What i have tried

Wallet info

Host:  VPS IP
Login: rpcusername from wallet.conf
Pass: rpcpassword from wallet.conf
Port: rpc port from wallet.conf

in addition I have also tried

Host:  VPS IP
Login: rpcusername from wallet.conf
Pass: rpcpassword from wallet.conf
Port: port from wallet.conf

My question Since I have to log into the VPS do i need to put something else in the VPS to allow my Webserver  to gain access without a username and pasword, like I need when logging into my VPS, the script asks for the wallet info but not the actual login info for the VPS.

I am new to all of this so please have patience with me.

ALso they installed CSF firewall on the VPS is there something I need to do to allow the webserver thru the CSF firewall?
What about in the Apache2.conf is there something I need to input there?

 Thank you for your help.
Pages:
Jump to: