Bitcoin Forum
September 27, 2016, 06:56:31 PM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: PHP rpcallowip, what am I doing wrong?  (Read 3305 times)
Anonymous
Guest

October 31, 2010, 02:49:28 AM
 #1

adg
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1475002591
Hero Member
*
Offline Offline

Posts: 1475002591

View Profile Personal Message (Offline)

Ignore
1475002591
Reply with quote  #2

1475002591
Report to moderator
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
November 01, 2010, 03:37:59 PM
 #2

Looks good to me.

Try to connect then look at the end of bitcoin's debug.log; see if it is even getting the connection.

Also:  did you restart bitcoind after adding the rpcallowip?  The .conf file is only read at startup.

How often do you get the chance to work on a potentially world-changing project?
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
November 01, 2010, 05:05:43 PM
 #3

If bitcoin thinks the connection is not allowed, then it just ignores the connection attempt-- nothing is written to debug.log.  That's probably the right thing to do-- otherwise somebody malicious could try to fill up your hard disk by repeatedly attempting to connect to port 8332.

If you can recompile bitcoind, the "ClientAllowed" routine in rpc.cpp is where a printf() to log connections could go.  But I'd guess either you misspelled "rpcallowip" (I always type rcp instead of rpc...) or have a firewall blocking connections.

If you can ssh into the web server machine (or any other machine, actually), try:
  curl http://machine_or_ip:8332/

If you get "couldn't connect to host" then it is a firewall problem.
If you get "Empty reply from server" then it is an rpcallowip problem.
If you get an HTTP "Authorization Required" or "Authorization Failed" reply, then it is a username/password mismatch (those ARE logged in debug.log, though-- grep for ThreadRPC).

How often do you get the chance to work on a potentially world-changing project?
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1470


View Profile
November 01, 2010, 05:18:51 PM
 #4

If bitcoin thinks the connection is not allowed, then it just ignores the connection attempt-- nothing is written to debug.log.  That's probably the right thing to do-- otherwise somebody malicious could try to fill up your hard disk by repeatedly attempting to connect to port 8332.

It is wrong to discard useful information about a potential attack.

This sort of thing is typically solved by rate-limiting.

Jeff Garzik, bitcoin core dev team and BitPay engineer; opinions are my own, not my employer.
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
November 01, 2010, 09:26:46 PM
 #5

Does it work if you (temporarily) set rpcallowip=*  ?

And are you SURE you're running a bitcoind that supports rpcallowip?  Run bitcoind getinfo, and check the "version" value returned (version 0.3.12 or later, if I'm reading the source correctly).

How often do you get the chance to work on a potentially world-changing project?
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652


Chief Scientist


View Profile WWW
November 02, 2010, 02:21:53 PM
 #6

Ok, looks like two problems-- if rpcallowip=* works, then maybe bitcoin thinks your IP is something else (or maybe there is a bug in the bitcoin rpcallowip code).  Run this on the web server:
Code:
curl http://www.whatismyip.com/automation/n09230945.asp

As to why the PHP code isn't working-- can you turn on error_reporting and get more information on what isn't working?

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!