Bitcoin Forum
May 04, 2024, 03:16:33 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] Connect to bitcoind from outside  (Read 3743 times)
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 06:51:47 PM
Last edit: June 26, 2011, 08:46:47 PM by Soak
 #1

Hello,

I have a dedicated server with a bitcoin daemon running somewhere on Internet. I try to reach it on another dedicated server (with JSON and PHP), the page loading for a while and nothing happen.

My bitcoin.conf file :
Quote
rpcuser=user
rpcpassword=pass
rpcallowip=client server IP
server=1
rpcport=8332

I launch daemon with ./bitcoind -daemon. ./bitcoind getinfo works.

curl http://user:pass@127.0.0.1:8332/ works.

Quote
admin@daemon:~$ curl http://user:pass@127.0.0.1:8332/
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

curl http://user:pass@server daemon IP:8332/ don't work.

Quote
admin@daemon:~$ curl http://user:pass@server daemon IP:8332/
curl: (7) couldn't connect to host

Anybody can help me please?
1714792593
Hero Member
*
Offline Offline

Posts: 1714792593

View Profile Personal Message (Offline)

Ignore
1714792593
Reply with quote  #2

1714792593
Report to moderator
1714792593
Hero Member
*
Offline Offline

Posts: 1714792593

View Profile Personal Message (Offline)

Ignore
1714792593
Reply with quote  #2

1714792593
Report to moderator
1714792593
Hero Member
*
Offline Offline

Posts: 1714792593

View Profile Personal Message (Offline)

Ignore
1714792593
Reply with quote  #2

1714792593
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
JoelKatz
Legendary
*
Offline Offline

Activity: 1596
Merit: 1012


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 26, 2011, 07:03:09 PM
 #2

Show us the 'netstat' line that shows the LISTENING socket on port 8332. Is it bound to 127.0.0.1?

I am an employee of Ripple. Follow me on Twitter @JoelKatz
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 07:06:52 PM
 #3

Show us the 'netstat' line that shows the LISTENING socket on port 8332. Is it bound to 127.0.0.1?

Quote
netstat
tcp        0      0 *:8332                  *:*                     LISTEN

Quote
netstat -an
tcp        0      0 0.0.0.0:8332            0.0.0.0:*               LISTEN

That's wrong? How I can modify that?
JoelKatz
Legendary
*
Offline Offline

Activity: 1596
Merit: 1012


Democracy is vulnerable to a 51% attack.


View Profile WWW
June 26, 2011, 07:17:02 PM
 #4

No, that's correct. Make sure the IP address you are connecting *from* is allowed in the conf file.

I am an employee of Ripple. Follow me on Twitter @JoelKatz
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 07:24:11 PM
 #5

No, that's correct. Make sure the IP address you are connecting *from* is allowed in the conf file.

Yes. The IP address in the conf file is correct. I added the server daemon "outside" IP in the conf file.

Quote
rpcallowip=client IP address
rpcallowip=server daemon IP address

Quote
admin@daemon:~$ curl http://user:pass@server daemon IP:8332/
curl: (7) couldn't connect to host

I don't know what to do now.. Sad
ShaggyB (BitCoinWorldMarket)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile WWW
June 26, 2011, 07:31:57 PM
 #6

Do you have a firewall blocking incoming 8332 connections?
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 07:33:57 PM
 #7

Do you have a firewall blocking incoming 8332 connections?

How I can verify that please?
ShaggyB (BitCoinWorldMarket)
Newbie
*
Offline Offline

Activity: 32
Merit: 0


View Profile WWW
June 26, 2011, 07:35:40 PM
 #8

If you are on a windows box, go to control panels and firewall settings. You will likely have to create a rule for that port. If you are on a linux box or other, i cant help you. Google is your friend for that.
progre55
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
June 26, 2011, 07:37:21 PM
 #9

what machine are you on? windows or linux?
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 07:39:36 PM
 #10

what machine are you on? windows or linux?

The daemon is currently running on Debian 6.0 64 bits.
progre55
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
June 26, 2011, 07:48:24 PM
 #11

then to check if you have any port restrictions on your current machine
Code:
iptables -L
with more info on iptables, refer to https://help.ubuntu.com/community/IptablesHowTo

other than that, make sure you're not behind a corporate network, or amazon clouds or anything =)
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 07:51:25 PM
 #12

Code:
iptables -L

Quote
root@daemon:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
progre55
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
June 26, 2011, 07:58:52 PM
 #13

well it means you dont have any rules..
btw, try telneting to your machine from outsite
Code:
telnet host port
and see if it accepts connections. If not, then there's definitely a firewall somewhere outside your own machine.
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 08:10:15 PM
 #14

Code:
telnet host port

Quote
soak@client:~$ telnet 88.191.128.82 8332
Trying 88.191.128.82...
Connected to 88.191.128.82.
Escape character is '^]'.
Connection closed by foreign host.
progre55
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
June 26, 2011, 08:14:22 PM
 #15

Even I was able to connect to your server
Code:
progre55@progre55:~$ curl http://user:pass@88.191.128.82:8332/
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

I dont see any problems.. so it's probably on your client side
Soak (OP)
Full Member
***
Offline Offline

Activity: 213
Merit: 100



View Profile
June 26, 2011, 08:20:39 PM
Last edit: June 26, 2011, 08:51:29 PM by Soak
 #16

I dont see any problems.. so it's probably on your client side

Now that's works with rpcallowip=*.*.*.*, but don't with PHP and JSON.

Edit: Now it's ok since I explain my problem on the IRC channel of my hosting provider, by miracle the server is reachable on port 8332 (I don't give the IP of my server!). Awesome.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!