craigwatson / bitcoind-status

PHP application to display status and information from the Bitcoin node daemon.
https://odin.vikingserv.net
Apache License 2.0
82 stars 77 forks source link

RPC Error #26

Closed DemonRx closed 8 years ago

DemonRx commented 8 years ago

Hi Craig, some reason the node-status page I'm running for my altcoin has stopped working. I believe it may have occured after the recent php update to version 5.5.9 including curl as well.

currently when i run > curl -Ssk http://cryptostakers.com/node/stats.php > i get the error > 173.245.xxx.xxx is not in the whitelist (however this ip changes due to the server being behind cloudflare)

so i'm not sure if the php script is trying to do rpc call from outside the server? it shouldn't be doing this however, since it wasn't doing so before. and if i add the ip to the whitelist, and run the same curl, i get "rpc error".

If you could assist with this, please and thank you.

craigwatson commented 8 years ago

The stats script should be run from the server itself, not from any other source, and should be run against localhost and not the server's hostname.

DemonRx commented 8 years ago

root@CryptoCube:~# curl -Ssk http://localhost/node/stats.php

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

404 Not Found

Not Found

The requested URL /node/stats.php was not found on this server.


Apache/2.4.7 (Ubuntu) Server at localhost Port 80

root@CryptoCube:~# curl -Ssk http://127.0.0.1/node/stats.php

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

404 Not Found

Not Found

The requested URL /node/stats.php was not found on this server.


Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 80

/var/www/clients/client0/web1/web/node/ < that's the stats page location, i see it in from the terminal and filezilla

craigwatson commented 8 years ago

From the looks of the error, your server could be set up to use different virtual hosts based on the hostname. Is your daemon running on the same server as the webserver running the scripts?

To be clear, the only supported configuration is for the following, running Bitcoin. If you don't have this configuration, I can make a best guess at what is happening, but unfortunately no more than that.

setup

DemonRx commented 8 years ago

Yes everything is on the same server, with cryptocube as the hostname. The server itself is a VPS on a Hosting Provider... and i have ispconfig for the cpanel, and cloudflare protection. also the hosting provider has their own Dos protection.

If you need me to do something to help figure out the configuration I have setup, let me know.

I'll be around later, or tomorrow.

On Mon, Jul 4, 2016 at 12:13 PM, Craig Watson notifications@github.com wrote:

From the looks of the error, your server could be set up to use different virtual hosts based on the hostname. Is your daemon running on the same server as the webserver running the scripts?

To be clear, the only supported configuration is for the following, running Bitcoin. If you don't have this configuration, I can make a best guess at what is happening, but unfortunately no more than that:

[image: setup] https://camo.githubusercontent.com/02310654824a282315f7d865096a60dc69f05248/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f333238313636342f6274632e6a7067

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/craigwatson/bitcoind-status/issues/26#issuecomment-230321365, or mute the thread https://github.com/notifications/unsubscribe/ARlCrpojhN00nNbaVaxGs349XhZe-QWVks5qSTEQgaJpZM4JEdTQ .

craigwatson commented 8 years ago

As I said, without knowing your exact server setup, complete with Apache virtual hosts, I'm unable to help any further.

My best guess is that your Apache configuration is not set to serve that DocumentRoot to requests for localhost, so I would suggest that you start there.

Your rpc_host entry in php/config.php file should be pointing to localhost, as should your cron commands using curl. If Apache is set up correctly, then everything else should work.

DemonRx commented 8 years ago

https://www.howtoforge.com/perfect-server-ubuntu-14.04-apache2-php-mysql-pureftpd-bind-dovecot-ispconfig-3-p4

that's the setup i went by

On Mon, Jul 4, 2016 at 1:09 PM, Craig Watson notifications@github.com wrote:

As I said, without knowing your exact server setup, complete with Apache virtual hosts, I'm unable to help any further.

My best guess is that your Apache configuration is not set to serve that DocumentRoot to requests for localhost, so I would suggest that you start there.

Your rpc_host entry in php/config.php file should be pointing to localhost, as should your cron commands using curl. If Apache is set up correctly, then everything else should work.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/craigwatson/bitcoind-status/issues/26#issuecomment-230329114, or mute the thread https://github.com/notifications/unsubscribe/ARlCrg8JvoyEJ52CsiRFnIGiIduMoy6jks5qST5FgaJpZM4JEdTQ .

DemonRx commented 8 years ago

ok fixed the DocumentRoot,

now the output says ->

root@CryptoCube:/etc/apache2/sites-enabled# curl -Ssk http://localhost/node/stats.php <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

403 Forbidden

Forbidden

You don't have permission to access /node/stats.php on this server.


Apache/2.4.7 (Ubuntu) Server at localhost Port 80
craigwatson commented 8 years ago

That now looks like file permission/ownership problems.

DemonRx commented 8 years ago

curl -Ssk http://localhost/node/stats.php

::1 is not in the whitelist

??

craigwatson commented 8 years ago

Try 127.0.0.1 instead of localhost - ::1 is IPv6.

DemonRx commented 8 years ago

curl -Ssk http://127.0.0.1/node/stats.php

RPC Error

craigwatson commented 8 years ago

Check your php/config.php - beyond this I'm unable to help further. If the config.php file is configured correctly, the RPC client will be able to respond.

DemonRx commented 8 years ago

should i change the config.php host to 127.0.0.1?

craigwatson commented 8 years ago

If your daemon is listening on IPv6, then localhost should work. If not, then it'll need to be 127.0.0.1.

DemonRx commented 8 years ago

root@CryptoCube:~# lsof -i :8332 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME DigiCubed 23264 root 19u IPv4 3422706493 0t0 TCP *:8332 (LISTEN) ^^ The daemon

DemonRx commented 8 years ago

php/config.php setup -> $config = array( // RPC 'rpc_user' => 'digicube', 'rpc_pass' => '[omitted]', 'rpc_host' => 'localhost', 'rpc_port' => '8332', 'rpc_ssl' => false, 'rpc_ssl_ca' => null,

craigwatson commented 8 years ago

I'm not sure I can offer much help here - try 127.0.0.1 and see if it fixes the issue. Ultimately I only really support the script, anything on the RPC side is the user's responsibility.

DemonRx commented 8 years ago

http://cryptostakers.com/node/

DemonRx commented 8 years ago

LOL

i just testing with sprouts coindaemon it works. there's something wrong with the digicube daemon, i'll have to contact the dev see what he fucked up in it.

craigwatson commented 8 years ago

No problem, I'll close this issue.

DemonRx commented 8 years ago

ty for your help today