-
Notifications
You must be signed in to change notification settings - Fork 5
Installing Bitcoin On A Laptop For Use On A Shared Server
I originally ran a server on my laptop. In order to enable my shared hosting accounts to connect to my local laptop I used ngrok.com. I've since moved the server to its own VPS but the setup on the laptop works quite well.
Download, install and use the instructions from here - https://ngrok.com/download. Especially notice the help command (./ngrok -help). use it to test after install.
Then visit the documentation tab (https://ngrok.com/usage). It tells you to use ngrok 80 to start it but you need to use the same syntax as for the help command. Enter ./ngrok 80 instead and it will generate a link - something like http://6b633173.ngrok.com -> 127.0.0.1:80.
In the included code there is a sample of what to use on your shared server (the file REMOTE_SHARED_HOST_INDEX_FILE/index.OS.php). In it is a line of code "$file = http://your_VPS_address_here/process_testnet.php". Replace that example link with the ngrok link so that it looks something like
$file="http://6b633173.ngrok.com -> 127.0.0.1:80/process_testnet.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $file); curl_setopt($ch, CURLOPT_POSTFIELDS, array('user_id' => $account, 'isTestCoin'=> 1 )); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); echo $data;
Use that block of code on a test page on your shared server. When everything is working properly it will deliver the results of the scripting work checking the blockchain being done on the laptop.