Author

Topic: Can’t connect to bitcoind from web server (Read 3059 times)

newbie
Activity: 29
Merit: 2
April 28, 2017, 03:03:35 PM
#15
I got a total refund from Godaddy (they were very professional) and bought a second VPS server from DigitalOcean. I connected the two servers and the thing works like a charm! The issue was resolved!
It was clearly a "Goddady issue".

I think that Achow101 gave the exact answer to the problem:

Make sure that your godaddy server allows outgoing connections to whatever rpcport you are using.
 
But Cloverme helped me a lot too with his posts!  

Achow101 please give me your address (pm), I will send you 45$ in BTC.
Cloverme please give me your address (pm), I will send you 15$ in BTC.
60$ total in BTC (instead of 50)

I hope you agree. Smiley

ps: jonald_fyookball thank you too man for your time! Wink



legendary
Activity: 1512
Merit: 1057
SpacePirate.io
You can try, but they're kind of dickheads about payments and orders when they became the walmart of domain/hosting. My guess is that if you don't take no for an answer, you might be able to get a refund. Good luck  Wink
newbie
Activity: 29
Merit: 2
You are right. I think I will leave Godaddy, especially if it is a port problem and refuse to open it... I already lost 2 weeks with this issue.
Do they refund the remaining period if I stop with them?
legendary
Activity: 1512
Merit: 1057
SpacePirate.io
While not on your exact topic of help... Why did you move hosts to godaddy if it was working at ocean digital?  Ocean has some of the best documentation for lamp stacks and securing them. Godaddy is not really that great at a lot of services, in the end, you'll get frustrated and want to move away from them.
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
The links that you are giving me do not refer to the type of Godaddy. It is not a dedicated server, it's just web hosting. Precisely it is "Deluxe Linux Hosting with cPanel" so I have access to it via cPanel. From what I saw I can only ban IPs, but not open ports.
I can access also via SSH (with PuTTY) and FTP, but I do not have root access...

I already did in bitcoin.config as you say...
Code:
rpcuser=ausername
rpcpassword=apassword
daemon=1
server=1
rpcport=2424
rpcallowip=the Website IP for GoDaddy
keypool=10000
prune=600
maxuploadtarget=20
maxconnections=16


The thing does not work remotely and I don't know if I am missing something...  Huh




if its not your dedicated server and you dont have root, you will have to ask your host to do the commands for you. they may or may not allow it depending on their policies. 
newbie
Activity: 29
Merit: 2
The links that you are giving me do not refer to the type of Godaddy. It is not a dedicated server, it's just web hosting. Precisely it is "Deluxe Linux Hosting with cPanel" so I have access to it via cPanel. From what I saw I can only ban IPs, but not open ports.
I can access also via SSH (with PuTTY) and FTP, but I do not have root access...

I already did in bitcoin.config as you say...
Code:
rpcuser=ausername
rpcpassword=apassword
daemon=1
server=1
rpcport=2424
rpcallowip=the Website IP for GoDaddy
keypool=10000
prune=600
maxuploadtarget=20
maxconnections=16


The thing does not work remotely and I don't know if I am missing something...  Huh

legendary
Activity: 1512
Merit: 1057
SpacePirate.io
So, a couple of things to try... Your server is going to have 2 ip addresses, the ip address that's internal to the server and one that is a public ip address.

In your bitcoin.conf file, for rpcallowip, use the internal ip address, which is where the requests are coming from. It's likely that the firewall is blocking the local port on the local ip address. I'm not sure what kind of shell access you have on your host, but you could temporarily stop the firewall service to see if you get a connect to see if the issue is isolated to your firewall, just remember to turn it back on Wink

https://www.godaddy.com/help/configuring-firewall-ip-addresses-in-simple-control-panel-2297
https://www.godaddy.com/help/find-your-servers-ip-address-12071

If you change the ip address in the the .conf file, you have to remember to restart bitcoind to pick up the new settings. If you're tired, you might miss a restart in troubleshooting.


What kind of Godaddy hosting service are you using? I might have some credits where I can use them and give you step by step instructions for setup and configuration.



newbie
Activity: 29
Merit: 2
I contacted GoDaddy. It is not possible to manually open ports as I don't have root access there.
But, I checked with an online port scanner and I saw that there are open ports. I used them with no success...
newbie
Activity: 29
Merit: 2
The server has cPanel... is it possible to check it there?
(as I remember I don't have root access)
staff
Activity: 3458
Merit: 6793
Just writing some code
Make sure that your godaddy server allows outgoing connections to whatever rpcport you are using.
newbie
Activity: 29
Merit: 2
I contacted Ocean Digital who proposed me to open needed ports with:
Code:
sudo ufw allow port [port number]

I dit it and then with:
Code:
Sudo ufw status verbose
  I saw that all needed ports (8332 and 8333) are opened!!

Then I went here : http://www.yougetsignal.com/tools/open-ports/ to check the ports. I saw that port 8333 was open, but port 8332 remained closed!!
 
So I opened another port (2424) with
Code:
sudo ufw allow 2424
something that was proved successful here:  http://www.yougetsignal.com/tools/open-ports/.


When I run /var/www/html/test_call.php from the VPS (Ocean Digital)
Code:
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''localhost''2424');
$info $bitcoin->getinfo(); 
print_r($info); 
echo 
$info $info "Oops an error: ".$bitcoin->error;
?>

everything is ok because I receive: Array [version] => 140000 [protocolversion] => ...


BUT when I try to put the script in the Godaddy Web server
Code:
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''IP of VPS Ocean Digital''2424');
$info $bitcoin->getinfo(); 
print_r($info); 
echo 
$info $info "Oops an error: ".$bitcoin->error;
?>

then I keep receiving: Oops an error: Failed to connect to [IP-VPS] port 2424: Connection refused


Here is the actual bitcoin.conf file which is placed in /root/.bitcoin/bitcoin.conf in the VPS Server (Ocean Digital) running bitcoind.
Code:
rpcuser=ausername
rpcpassword=apassword
daemon=1
server=1
rpcport=2424
rpcallowip=the Website IP for GoDaddy
keypool=10000
prune=600
maxuploadtarget=20
maxconnections=16



I tried everything, I searched for about a week a solution for this issue but I nothing helped me. I checked tenths of pages who proposed different things  (adding rpcbind=rpcconnect=, even adding bitcoin.conf on both VPS and web server!! here https://bitcoin.stackexchange.com/questions/43216/connection-refused-from-external-server).
I am completely lost!

I am VERY tired, so I decided to offer 50$ in bitcoins to the person who really helps me with that!

I would appreciate if you could help me resolving this issue.


Thank you,

Nick
staff
Activity: 3458
Merit: 6793
Just writing some code
Thank you for your reply, I thought that port 8333 was ok because the server runs ok and received all the blocks.
I just created a ticked asking them if they block that port by default (and what to do to fix that)...
Receiving blocks and transactions does not mean that port 8333 is open. Bitcoin Core will make outbound connections (which are usually allowed by default) to other nodes in order to connect to the network. You won't have any incoming connections if you don't open port 8333.
newbie
Activity: 29
Merit: 2
Thank you for your reply, I thought that port 8333 was ok because the server runs ok and received all the blocks.
I just created a ticked asking them if they block that port by default (and what to do to fix that)...

staff
Activity: 3458
Merit: 6793
Just writing some code
Make sure that digital ocean itself is letting you receive traffic to port 8332. I know that with AWS that you need to configure some security settings of the VPS itself outside of its OS to allow traffic to certain ports.
newbie
Activity: 29
Merit: 2
Hello to everybody!
I have a bitcoind daemon running on a VPS server (ocean digital). Everything is set up ok and it is running with no issues!


I put this script in /var/www/html/test_call.php (in same folder with easybitoin.php) in the VPS (ocean digital):
Code:
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''localhost');
$info $bitcoin->getinfo(); 
print_r($info); 
?>


and everything is OK as I receive something like : Array ( [version] => 140000 [protocolversion] =>



Now, my problem is when I put the script in the Godaddy Web server /public_html/test_call.php (in same folder with easybitoin.php) it gives me a blanc screen. I do that because I don't want my web site run in the same server with the VPS that runs bitcoind (i will add later a SSH tunnel between them). Here is the test_call.php file in GoDaddy:
Code:
require('easybitcoin.php');
$bitcoin = new Bitcoin('ausername''apassword''IP of VPS Ocean Digital');
$info $bitcoin->getinfo(); 
print_r($info); 
?>



And here is the bitcoin.conf:
Code:
rpcuser=ausername
rpcpassword=apassword
daemon=1
server=1
rpcallowip=the Website IP for GoDaddy
keypool=10000
prune=600
maxuploadtarget=20
maxconnections=16


I also tried opening ports 8332 and 8333 in the VPS (ocean digital) with
Code:
sudo ufw allow
with no result.


I also changed the port in bitcoin config by adding the line
Code:
rpcport=570
and by changing line 3 in test_call.php
Code:
$bitcoin = new Bitcoin('ausername', 'apassword', 'IP of VPS Ocean Digital', '570');



I searched a lot and found a lot of similar issues from other users, but I couldn’t find the solution.
It seems like am doing something wrong and the rpc is not working properly.
Any ideas please?

Thank you
Nick
Jump to: