SHARE
TWEET

Untitled

a guest May 12th, 2014 1,361 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SSH into VPS
  2.  
  3. Update:
  4. sudo apt-get update
  5. sudo apt-get upgrade
  6.  
  7. change timezone
  8. sudo dpkg-reconfigure tzdata
  9.  
  10. Install bitcoind:
  11. wget -O btcNode.sh https://raw.github.com/XertroV/BitcoinAutoNode/master/bitcoinAutoNode.sh ; sudo bash btcNode.sh
  12.  
  13.  
  14. Install bitcoinrpc:
  15. sudo apt-get install git
  16. git clone https://github.com/jgarzik/python-bitcoinrpc
  17. cd python-bitcoinrpc
  18. python setup.py build
  19. python setup.py install
  20.  
  21.  
  22. Install vnstat if you want a bandwidth monitor
  23. sudo apt-get install vnstat
  24. vnstat -i eth0 (or whatever interface you are using. Some VPS use venet0)
  25. vnstat -u -i eth0
  26. sudo apt-get install apache2 php5 php5-gd
  27. sudo /etc/init.d/apache2 start
  28. sudo ufw allow 80
  29. cd /tmp
  30. wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
  31. tar xvf vnstat_php_frontend-1.5.1.tar.gz
  32. cp -fr vnstat_php_frontend-1.5.1/ /var/www/vnstat
  33. vi /var/www/vnstat/config.php (Change location to en for english, and change interface card to yours)
  34.  
  35.  
  36. Add crontab jobs for vnstat and btc-update.py
  37. crontab -e
  38. I use vim to edit files. Hit 'I' to insert, paste the text below, then hit esc and type :wq and hit enter to write and quit vim.
  39.  
  40. */5 * * * * python /usr/local/bin/btc-update.py
  41. */5 * * * * /usr/bin/vnstat -u >/dev/null 2>&1
  42.  
  43.  
  44. If ufw isn't installed on VPS:
  45. sudo apt-get install ufw
  46. sudo ufw allow 8333/tcp
  47. sudo ufw allow 22/tcp
  48. sudo ufw allow 80
  49.  
  50.  
  51. Add webUI python script
  52. sudo vim /usr/local/bin/btc-update.py
  53.  
  54. Copy/Paste all of this. Replace RPCUSER, RPCPASSWORD, IP Address, Location, and Donation Address.
  55. RPCUSER and RPCPASSWORD can be found at:
  56. vim ~/.bitcoin/bitcoin.conf
  57.  
  58. #!/usr/bin/python
  59. from bitcoinrpc.authproxy import AuthServiceProxy
  60. import time
  61.  
  62. access = AuthServiceProxy("http://RPCUSER:PRCPASSWORD@127.0.0.1:8332")
  63. info = access.getinfo()
  64.  
  65. ff = open('/var/www/index.html', 'w')
  66.  
  67.  
  68. ff.write("<!DOCTYPE html>")
  69. ff.write("<html lang='en-us'>")
  70. ff.write("<head>")
  71. ff.write("<meta charset='utf-8'>")
  72. ff.write("<title>Bitcoin Node Status</title>")
  73. ff.write("<link href='http://fonts.googleapis.com/css?family=Exo+2:300,400' rel='stylesheet' type='text/css'>")
  74. ff.write("<style type='text/css'> ")
  75. ff.write("</style>")
  76. ff.write("</head>")
  77. ff.write("<body>")
  78.  
  79. ff.write("<link href='http://fonts.googleapis.com/css?family=Exo+2:300,400' rel='stylesheet' type='text/css'>")
  80. ff.write("<style>")
  81.  
  82. ff.write("/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */")
  83. ff.write("html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}")
  84.  
  85. ff.write("html,body{height:100%;}")
  86. ff.write("body{")
  87. ff.write("color: #444;")
  88. ff.write("background: url(http://www.babayara.com/wp-content/uploads/2013/08/vlcsnap-2013-08-24-23h14m34s7.png) no-repeat;")
  89. ff.write("}")
  90.  
  91. ff.write("#wrap{")
  92. ff.write("background-color: rgba(255, 255, 255, 0.6);")
  93. ff.write("width: 100%;")
  94. ff.write("height: 100%;")
  95. ff.write("padding-top: 50px;")
  96. ff.write("padding-left: 50px;")
  97. ff.write("line-height: 1.4;")
  98. ff.write("font-size: 24px;")
  99. ff.write("font-family: 'Exo 2', sans-serif;")
  100. ff.write("}")
  101.  
  102. ff.write("h3{")
  103. ff.write("font-weight: 300;")
  104. ff.write("}")
  105.  
  106. ff.write("h1{")
  107. ff.write("font-weight: 400;")
  108. ff.write("margin-bottom: 15px;")
  109. ff.write("}")
  110. ff.write("</style>")
  111. ff.write("<div id='wrap'>")
  112. ff.write("<h1>Bitcoin Node: 192.227.137.5:8333<br \></h1>")
  113. ff.write("<h3>")
  114.  
  115. ff.write("Last Update: " + time.strftime("%H:%M:%S %Y-%m-%d") + "<br \>\n")
  116. ff.write("Connections: " + str(info['connections']) + "<br \>\n")
  117. ff.write("Blocks: " + str(info['blocks']) + "<br \>\n")
  118. ff.write("Difficulty: " + str(info['difficulty']) + "<br \>\n")
  119.  
  120. ff.write("Location: Dallas, TX")
  121. ff.write("</h3>")
  122. ff.write("<br>Node created by <a href='https://bitcointalk.org/index.php?action=profile;u=58076'>Morblias</a>")
  123. ff.write("<br>Donate: 1Morb18DsDHNEv6TeQXBdba872ZSpiK9fY")
  124. ff.write("<br><a href='https://blockchain.info/address/1Morb18DsDHNEv6TeQXBdba872ZSpiK9fY'><img src='http://qrfree.kaywa.com/?l=1&amp;s=4&amp;d=1Morb18DsDHNEv6TeQXBdba872ZSpiK9fY' alt='QRCode'></a>")
  125. ff.write("</div>")
  126. ff.write("</body></html>")
  127.  
  128. ff.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top