Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
vps_setup_guide [2018/09/18 05:21]
admin Removed some other VPS providers text and put PT VPS.
— (current)
Line 1: Line 1:
-===== VPS SETUP GUIDE===== 
  
-====Diesel’s Installing Profit Trailer on a VPS==== 
- 
-(Note: Also see this new guide for configuring the VPS once installed; [[vps_setup_commands_to_use|]]) 
- 
-This is a guide to installing and running Profit Trailer on a Ubuntu VPS. It utilizes NodeJS, NPM, JAVA JDK and PM2. The basic installation should work on any system, with minor deviations - this is Ubuntu, installations on Windows, OSX and RaspPI will be different, but the applications are the same. 
- 
-If you haven’t gotten a license for Profit Trailer yet, or want to throw me a little support, visit my Website http://​DieselSettings.com. Get a referral code for Binance there, as well as 10% Cointracking.info with my referral for that. 
----- 
-===Get a VPS=== 
- 
-Get your VPS from [[preinstalled_vps|from here]]. ​ This tutorial is designed for Ubuntu, but the differences are minimal. ​ 
- 
----- 
-===Connect to your new VPS=== 
-I use WinSCP to connect to my VPS. It runs on Windows. (A good Mac product is "VNC Viewer"​). You can use anything you are comfortable with, but WinSCP allows me to connect to the VPS, FTP files, edit files and has PuTTY integrated into the app. So I can move files, edit files and also connect to the terminal in one nice little free app. https://​winscp.net/​eng/​index.php 
- 
-Your provider will have given you access information:​ an IP Address, username and password. In my case, Westhost gave me root user, which is fine. Use this info to open a terminal window to your new VPS.  In my case I open Winscp and set up a new connection: 
- 
-{{:​ptwinscpui.png|}} 
- 
-In WinSCP, I click the terminal icon in the menu bar to get to a terminal: 
- 
-{{:​ptwinscpterm.png|}} 
-  
- 
-{{:​ptwinscpwindow.png|}} 
- 
- 
-I like to drop my bots into the /var/opt folder: 
-From the main root login, 
-            cd .. 
-            cd /var/opt 
-            mkdir pt 
-            cd pt 
-  
-You should now be inside a folder called pt in your /var/opt path 
-The prompt will look similar to this: 
-            root@proxybot:/​var/​opt/​pt#​ 
-  
-run an update: 
-            sudo apt-get update 
-            sudo apt-get install default-jdk 
-            sudo apt-get install nodejs 
-            ln -s /​usr/​bin/​nodejs /​usr/​bin/​node 
-            sudo apt-get install npm 
-            npm install pm2@latest -g 
-  
-pm2 is a process manager – it lets you run the bot in the background, and has features to autostart, log-rotation and much more. You do not HAVE to use pm2, but I like it and rely on it, especially from running multiple bots. 
-http://​pm2.keymetrics.io/​docs/​usage/​quick-start/​ 
-  
-At this point you have all the apps and tools you need to run the Profit Trailer. 
-            Java to run the jar 
-            Nodejs to run pm2 
-            Pm2 to manage your bot process, log windows and logs 
-  
-Type pm2 at your prompt and you should get a list of pm2 commands. This will verify everything is running as expected. 
- 
----- 
- 
-===Download ProfitTrailer=== 
- 
-I like to download the bot to my local machine, edit the configs and then upload everything to the VPS at one time. I’ll show you how I do that. If you are familiar with Linux, you can certainly download and unzip the bot directly to your working folder. 
-  
-Follow these [[|https://​wiki.profittrailer.com/​doku.php?​id=instructions#​download_java_profittrailer_to_your_computer|instructions]] to find the most current download location for the files. ​ 
- 
-I unzip the file into folder named with the version number (PT 1.2.x.x) 
-You should have something similar to 
-{{:​ptwinvpsfiles.png|}} 
-  
-Open WinSCP, and connect to your VPS. 
-  
-Select the “Open directory/​bookmark” icon and type in /var/opt/pt 
-  
-This should bring you to your pt folder 
-{{:​ptwinvpsptfolder.png|}} 
-  ​ 
-In the left hand window of WinSCP, find your new PT folder, the one you just unzipped from the download. 
- 
-Things should look like this 
-{{:​ptwinvpszip.png|}} 
- 
- 
-Simply select and drag all of the files from the left window to the right window. 
-{{:​ptwinvpsupload.png|}} 
- 
-You now have the PT files on your VPS, and are ready to start editing configs. 
- 
-**CONFIGURING YOUR BOT IS NOT IN THE SCOPE OF THIS TUTORIAL** Go here ([[instructions]]) to continue setup of the bot itself. Some of the instructions you have already completed, but we assume you are smart enough to figure that out.  
- 
-You can double-click on a file in WinSCP to edit that file (left or right windows). The bot will be using the files on the right, in the /var/opt/pt folder. 
-  
-At this point, you can minimize WinSCP and go back to your terminal window (or click on the terminal icon to connect again) 
- 
----- 
-===Running the Bot=== 
-Now for the fun part. To run your bot, you first navigate to your pt folder 
- 
-  cd /var/opt/pt 
- 
-Change the permission on the JAR file so it will execute correctly 
-  chmod +x ProfitTrailer.jar 
- 
-Start the bot using pm2:    
-  pm2 start pm2-ProfitTrailer.json 
- 
-{{:​ptwinvpspm2.png|}} 
- 
-At this point, the bot is running. To see the live log scrolling by, type pm2 log 0. You use CTRL-C to get out of the window. 
-  pm2 log 0          See log live 
-  pm2 stop 0        Stop the bot 
-  pm2 reload 0   ​ reload and restart the bot 
- 
-Text logs are maintained by pm2 and are located at /root/.pm2/ (for my root account access) 
- 
-Finally, run a save and startup command. Ater this is complete, PM2 will restart your bot if you restart the server. ​ Run this command again if you change your app, or add a second bot. 
- pm2 save 
- pm2 startup 
- 
----- 
- 
-====ADDING A SECOND BOT==== 
-Time to go bigger? Running a second bot is fairly straightforward. 
- 
-Make a second folder in your /var/opt/ folder, maybe pt2 
- 
-  /​var/​opt/​pt2 
- 
-Upload a copy of your Profit Bot to this folder. 
- 
-Edit the application.properties file and change the port number - I increment them by 1 
- 
-(If these variable do not exist, add them) 
- 
-In /​var/​opt/​pt/​application.properties 
-  server.port = 8081 
- 
-In /​var/​op/​pt2/​application.properties 
-  server.port = 8082 
- 
- 
----- 
- 
-===RUNNING THAT SECOND BOT IN PM2=== 
-You will need to edit /​var/​opt/​pt/​pm2-start.json in order to change the Application name. Pm2 requires unique application names. I like to edit all of my start jsons to be descriptive of the bot: 
- 
-{{:​ptwinvpsbot2.png|pm2-start.json}} 
- 
-Just start the second bot the same way you started the first: 
-pm2 start pm2-start.json 
-This will display PT Polo as the app name in the pm2 list. 
- 
----- 
-==== SSL Setup Guide ==== 
- 
-And here is a link to the SSL setup so you can monitor remotely: [[setup_ssl|SSL Setup]] 
  • vps_setup_guide.1537248091.txt.gz
  • Last modified: 9 months ago
  • by admin