Advertisement
Dante2333

Untitled

Oct 11th, 2017
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. How to get gunbot running on your virtual server - this guide assumes that you know how to get inside the linux server through SSH and does NOT cover all security measures, every line starting as $ means its a command as normal user, # means its a command as root (admin) on the command prompt. This also assumes that you are login as root for the first time on your server, the guide is adapted to work perfectly on Ubuntu 17.04;
  2.  
  3. You would have to login for the first time on your root account, we want to create a new user and add sudo permissions (add administrator permissions to it)
  4.  
  5. # adduser gunbot
  6. # usermod -aG sudo gunbot
  7. If you get any error msgs, means you did something wrong, the user that will be created has name "gunbot" and will become the user that we want to use. It will also ask you a few questions, you can just press enter on them and leave them blank, it will also prompt for a password, remember this as we will use it again to log back in.
  8.  
  9. $ ssh gunbot@IP where IP is your server IP, if you use putty its slightly different.
  10. when asked for the password use the password you created when adding the user.
  11.  
  12. Now we need to upgrade the server and set up the firewall
  13. $ sudo ufw status
  14. this will tell you if the firewall is inactive
  15. $ sudo ufw allow 22
  16. this will allow the users to use port 22 for ssh
  17. $ sudo ufw enable
  18. this will activate the firewall
  19. $ sudo apt-get update
  20. this will update the repositories sources
  21. $ sudo apt-get upgrade
  22. this will upgrade the system
  23. $ sudo apt-get install nodejs npm nodejs-legacy
  24. installation of the service program that will run gunbot or gunbot gui in the background (sjakil)
  25. $ sudo npm install -g pm2
  26. installation of pm2 to manage the bot
  27.  
  28. Now some of those commands will require y/n answer, please carefully select y or yes on the prompts by the console.
  29. Our server is almost ready, now we need to get gunbot going and unzip to unzip gunbot
  30. $ sudo apt-get install unzip
  31.  
  32. then we need to download gunbot, you go to https://github.com/GuntharDeNiro/Gunthy/releases then you grab the link, in this case, https://github.com/GuntharDeNiro/Gunthy/releases/download/5055RC/Gunthy_v5055_RC_8ab53b2.zip and then you go into the console an input this using wget command
  33.  
  34. $ wget "https://github.com/GuntharDeNiro/Gunthy/releases/download/5055RC/Gunthy_v5055_RC_8ab53b2.zip"
  35. this will download gunbot
  36. $ unzip *.zip
  37. this will unzip everything under the current directory, we only have Gunthy zip so it should only decompress that.
  38. $ ls
  39. this will show you the folders/files on the current directory where your shell is running, we now need to navigate to your gunbot folder, so we will do so using cd command
  40. $ cd foldername
  41. make sure to input folder name right, most of the time you can start writing the folder name and just press TAB on your keyboard to autocomplete it
  42. you now should be on the gunbot folder, we need to chmod gunthy executable by using
  43. $ chmod +x gunthy-linx64
  44. then now we are almost ready, we just need to modify our config.js which is our configuration file by using nano editor
  45. $ nano config.js
  46. make sure you are already on the folder that contains gunthy executable and config.js or you'll open a new file.
  47. then you can just proceed to edit, add your api keys and so on, after thats done then we need to run the bot on pm2
  48. we do so by using this command on the same directory as the executable
  49. $ pm2 start gunthy-linx64
  50. then you can see the process is running by using
  51. $ pm2 list
  52. this will also get you and ID which you can use monitor logs and stop/start the bot, most of the time it will be ID 0 if not was running so you can check it by using
  53. $ pm logs 0
  54. and you'll be looking at the logs, pressing CTR+C on your keyboard will close this screen in order to get back into the command prompt
  55.  
  56. Thats it, now your bot is running on the pm2 instance, if you want to stop the bot
  57. $ pm2 stop 0
  58. it could be different than 0 if you have more than 1 program running on pm2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement