Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: BartmaX on July 18, 2014, 01:06:13 PM



Title: Bitcoin Node problem
Post by: BartmaX on July 18, 2014, 01:06:13 PM
I installed it:
http://pastebin.com/wKytLZmc
I raplaced RPCUSER, RPCPASSWORD, IP Address, Location, and Donation Address to my, but my VPS doesn't show website.

Node address: 104.131.228.11
Node address with port: 104.131.228.11:8333

This node is working per 100%, I can see 27 conections.

I done everything, it should be ok, but I can't see GUI on my VPS.
It should be like this:
http://salomon.styx.net.pl/


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 18, 2014, 07:47:46 PM
Have you installed an apache2 package using your favourite package manager? The default site root should already be in /var/www/.



Title: Re: Bitcoin Node problem
Post by: ranochigo on July 19, 2014, 06:46:21 AM
Did you portforward? Try replacing the index on var/www with that code you have entered. Then restart apache server. Have you installed bitcoin RPC? Follow this tutorial. http://pastebin.com/qbmSNhWK


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 19, 2014, 12:20:27 PM
Did you portforward? Try replacing the index on var/www with that code you have entered. Then restart apache server. Have you installed bitcoin RPC? Follow this tutorial. http://pastebin.com/qbmSNhWK

You can't put python code into index.html without a python module for apache2. That code, if you read it, writes an HTML file with status to /var/www/index.html. All that is needed is a webserver installation that serves from /var/www and can be seen from outside (opening firewall ports, and portforwarding on router/cable modem)


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 20, 2014, 07:38:34 PM
How to change apache2 ubuntu default page to NODE statistic page?
104.131.228.11


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 20, 2014, 08:32:39 PM
Serve content from /var/www and have that script run. Or, you could modify the script to write to /var/www/html/index.html.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 20, 2014, 08:33:09 PM
Serve content from /var/www and have that script run. Or, you could modify the script to write to /var/www/html/index.html.
How? commands? thx bro


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 20, 2014, 08:43:39 PM
Take the python script you've been running (http://pastebin.com/wKytLZmc) and edit line 8 to read:

Code:
ff = open('/var/www/html/index.html', 'w')

Now have a cronjob (http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job) run that script every minute to update that page to reflect the actual state of your node.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 20, 2014, 08:49:56 PM
Take the python script you've been running (http://pastebin.com/wKytLZmc) and edit line 8 to read:

Code:
ff = open('/var/www/html/index.html', 'w')

Now have a cronjob (http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job) run that script every minute to update that page to reflect the actual state of your node.
So I have to only add /html/? Sry about that but I don't understand :(
And next - add cronjob.


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 20, 2014, 09:35:53 PM
Yes, you need to have the script write to the correct path, so add the /html/ to the appropriate place so it matches the line.

As for the cronjob, the link I gave should clear things up well.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 21, 2014, 07:36:50 AM
As for the cronjob, the link I gave should clear things up well.
Could You write me how to do it. It should reflesh every 5 min


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 21, 2014, 10:34:53 AM
OK, so do you have the script saved somewhere and made executable? Let's imagine that it's located at /foo/bar/node.py. Obviously yours will be different.

First we need to allow your script to write to the status file without needing to be run as root. You will need to run:

Code:
chmod 0777 /var/www/html/index.html

This will allow your script to write to index.html to actually update it.

I assume that you are familiar a terminal-based editor (vim or nano). Run

Code:
crontab -e

and add the following line to the file that you see:

Code:
*/5 * * * * python /foo/bar/node.py

Save and quit. Your crontab will have been applied and the script will run every 5 minutes, assuming the system is booted up (not necessarily logged in as you).

If this seems a bit convoluted to you, I can remotely set this up for BTC0.015.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 21, 2014, 10:48:34 AM
OK, so do you have the script saved somewhere and made executable? Let's imagine that it's located at /foo/bar/node.py. Obviously yours will be different.

First we need to allow your script to write to the status file without needing to be run as root. You will need to run:

Code:
chmod 0777 /var/www/html/index.html

This will allow your script to write to index.html to actually update it.

I assume that you are familiar a terminal-based editor (vim or nano). Run

Code:
crontab -e

and add the following line to the file that you see:

Code:
*/5 * * * * python /foo/bar/node.py

Save and quit. Your crontab will have been applied and the script will run every 5 minutes, assuming the system is booted up (not necessarily logged in as you).

If this seems a bit convoluted to you, I can remotely set this up for BTC0.015.
Ok, done. In how many min. should it show node page?


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 21, 2014, 11:15:10 AM
No more than 5, assuming you did it all correctly, and running
Code:
python /foo/bar/node.py
directly updates the page correctly as well.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 21, 2014, 11:18:53 AM
No more than 5, assuming you did it all correctly, and running
Code:
python /foo/bar/node.py
directly updates the page correctly as well.
python: can't open file '/foo/bar/node.py': [Errno 2] No such file or directory
:(


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 21, 2014, 11:25:47 AM
As I said in my previous post, you will need to update that path to reflect the actual location of the script.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 21, 2014, 11:29:14 AM
As I said in my previous post, you will need to update that path to reflect the actual location of the script.
I done it, but still I have got this error


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 21, 2014, 11:34:47 AM
The same error? You need to replace /foo/bar/node.py with the correct path in ALL of my replies on this topic. I was using that as an example path.


Title: Re: Bitcoin Node problem
Post by: zvs on July 24, 2014, 02:01:49 PM
As I said in my previous post, you will need to update that path to reflect the actual location of the script.
I done it, but still I have got this error

There's no way you'd get a 'file not found' if you actually put in the correct location of the file.

LOL, just noticed this was from 3 days ago.  I guess it's working now or you gave up, eh?


Title: Re: Bitcoin Node problem
Post by: ranochigo on July 25, 2014, 08:45:00 AM
As I said in my previous post, you will need to update that path to reflect the actual location of the script.
I done it, but still I have got this error
Check your file name, you may have some other name. Also, not everyone's directory is the same. You must edit or according to where you have the python script.


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 30, 2014, 02:28:49 PM
I made everything what U told.
How to change apache2 ubuntu default page to NODE statistic page?
I have got error:
Code:
python: can't open file 'node.py': [Errno 2] No such file or directory
I wrote:
Code:
echo `pwd`node.py
And I got:
Code:
/rootnode.py
There should be /root/node.py (I think). It's in /root and I can't open it. (I'm in /root)
Can somebody help?


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 30, 2014, 05:02:23 PM
Try
Code:
echo `pwd`/node.py

Do you have execute permissions set on the file?


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 30, 2014, 05:18:15 PM
Try
Code:
echo `pwd`/node.py

Do you have execute permissions set on the file?
I got this:
Code:
/root/node.py
Sorry I don't know what exactly You tell to me... I'm from Poland... :) It's my VPS, I'm logged as root.


Title: Re: Bitcoin Node problem
Post by: rarkenin on July 31, 2014, 11:36:03 AM
Try

Code:
chmod a+x /root/node.py


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 31, 2014, 01:38:59 PM
Try

Code:
chmod a+x /root/node.py
Code:
chmod: cannot access ‘/root/node.py’: No such file or directory
:(


Title: Re: Bitcoin Node problem
Post by: BartmaX on July 31, 2014, 03:42:13 PM
Who can help?


Title: Re: Bitcoin Node problem
Post by: rarkenin on August 01, 2014, 08:35:52 PM
In that case, you're really not understanding the basics here. If you actually saved the file as /root/node.py there would be no such issues. Use the actual location of the file.


Title: Re: Bitcoin Node problem
Post by: Bitcoin Charts on August 01, 2014, 09:42:46 PM
i think something wrong in your server or your list because i try it now all normal
Maybe you can run at moment ans restart again ;)


Title: Re: Bitcoin Node problem
Post by: Newar on August 02, 2014, 10:56:43 AM
The pastebin you linked to is from here: http://pastebin.com/qbmSNhWK

There is some more info in there. I have used it successfully before.


Edit: No Symbols for rpcuser and rpcpassword, only A-Z, a-z and 0-9.


Title: Re: Bitcoin Node problem
Post by: BartmaX on August 02, 2014, 03:17:46 PM
I done everything what You told and it still not works.
Node IP: 104.131.228.11


Title: Re: Bitcoin Node problem
Post by: BartmaX on August 02, 2014, 04:40:35 PM
Bro Newar helped me, thanks!
http://104.131.228.11


Title: Re: Bitcoin Node problem
Post by: cannon on August 05, 2014, 02:47:54 AM
thanks~dude