Advertisement
Guest User

CSGOFIT.ORG TRADER // INSTALLATION

a guest
Oct 9th, 2016
843
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. Instructions on how to install this script on Ubuntu 14.04/Debian systems
  2.  
  3. Install: nginx, php, mysql
  4.  
  5. Source - https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04
  6.  
  7. Nginx
  8.  
  9. sudo apt-get update
  10. sudo apt-get install nginx
  11. MySQL
  12.  
  13. Don't forget the password you set during the installation.
  14.  
  15. sudo apt-get install mysql-server
  16. sudo mysql_install_db
  17. sudo mysql_secure_installation
  18. PHP
  19.  
  20. This part is different to the Source. Copy from here.
  21.  
  22. sudo apt-get install php5-fpm php5-mysql php5-mcrypt
  23. CURL
  24.  
  25. This part is different to the Source. Copy from here.
  26.  
  27. sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
  28. sudo php5enmod curl
  29.  
  30. sudo service php5-fpm restart
  31. Configuring Nginx + Uploading the files and config
  32.  
  33. I personally use vim (sudo apt-get install vim) but you can use any linux editor. (nano etc..)
  34.  
  35. vim /etc/nginx/sites-available/default
  36. Once the file is open, press i and delete everything in the file. If deleted, paste this code below and change server_name to your domain.
  37.  
  38. server {
  39. listen 80;
  40. server_name yourdomain.com;
  41.  
  42. root /home/www/tradescript/public;
  43. index index.php index.html index.htm;
  44.  
  45. location / {
  46. try_files $uri $uri/ /index.php?$query_string;
  47. }
  48. location ~ \.php$ {
  49. try_files $uri /index.php =404;
  50. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  51.  
  52. fastcgi_connect_timeout 60;
  53. fastcgi_send_timeout 180;
  54. fastcgi_read_timeout 180;
  55. fastcgi_buffer_size 128k;
  56. fastcgi_buffers 256 16k;
  57. fastcgi_busy_buffers_size 256k;
  58. fastcgi_temp_file_write_size 256k;
  59. fastcgi_max_temp_file_size 0;
  60.  
  61. fastcgi_pass unix:/var/run/php5-fpm.sock;
  62. #fastcgi_read_timeout 200;
  63. fastcgi_index index.php;
  64. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  65. include fastcgi_params;
  66. }
  67. }
  68. Then press ESC and CTRL + Z (press Z twice). This saves the file.
  69.  
  70. Restart nginx again
  71.  
  72. sudo service nginx restart
  73. Now we need to create the folder where to upload the files.
  74.  
  75. mkdir -p /home/www/tradescript
  76. Upload website folder files to /home/www/tradescript. Once the upload has finished we need to chmod the storage folder.
  77.  
  78. chmod -R 777 /home/www/tradescript/storage
  79. Now we need to edit the .env file because the website will not work otherwise..
  80.  
  81. vim /home/www/tradescript/.env
  82. Press i to edit the file, and change the values of these parameters to your liking. Other parameters are not necessary to change. Keep in mind that BOT_URL_OR_IP needs to be your public ip and port 1337 since the bot runs on 1337 port (Also don't forget to add / to the end). Also don't forget DB_PASSWORD, it is what you set before when installing MySQL.
  83.  
  84. BOT_STEAMID=botsteamid
  85. BOT_URL_OR_IP=85.85.85.85:1337/
  86. STEAM_API_KEY=your_steam_api_key
  87. BACKPACKTF_APIKEY=backpack_tf_api_key
  88. MODIFIER_KEY_USER=1
  89. MODIFIER_KEY_BOT=1.05
  90. MODIFIER_KNIFE_USER=0.93
  91. MODIFIER_KNIFE_BOT=0.96
  92. MODIFIER_WEAPON_USER=0.83
  93. MODIFIER_WEAPON_BOT=0.89
  94. MODIFIER_OTHER_USER=0.80
  95. MODIFIER_OTHER_BOT=0.86
  96. MODIFIER_TRASH_USER=0.28
  97. MODIFIER_TRASH_BOT=0.5
  98. MODIFIER_SOUVENIR_USER=0.01
  99. MODIFIER_SOUVENIR_BOT=0.2
  100. APP_URL=http://yourdomain.com
  101. DB_HOST=127.0.0.1
  102. DB_DATABASE=exchange
  103. DB_USERNAME=root
  104. DB_PASSWORD=password
  105. Then press ESC and CTRL + Z (press Z twice). This saves the file.
  106.  
  107. Uploading the MySQL database
  108.  
  109. Upload exchange.sql to /home. Then we create the database and upload data.
  110.  
  111. mysql -u root -p
  112. A password prompt will appear, enter your MySQL root password. Then you should see something like this mysql> now enter this command
  113.  
  114. CREATE DATABASE IF NOT EXISTS exchange;
  115.  
  116. exit
  117. Now lets upload the exchange.sql file to the database. There will be a password prompt again.
  118.  
  119. mysql -u root -p exchange < /home/exchange.sql
  120. The website should now be ready-to-use.
  121.  
  122. To update the prices open this url and wait until it has loaded. http://yourdomain.com/price/csgofast or http://yourdomain.com/price/backpack if you have the correct backpacktf api key in .env.
  123.  
  124. It would be wise to setup a cronjob for that, google about it.
  125.  
  126. Configuring and uploading the Bot
  127.  
  128. First we need NodeJS 0.12
  129.  
  130. curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
  131. sudo apt-get install -y nodejs
  132. Create a diectory for the bot
  133.  
  134. mkdir /home/www/tradescript_bot
  135. Configure the bot before uploading
  136.  
  137. Go to polls folder and rename the json file according to your bots account name.
  138. Go to users folder and replace master_ssfn with your ssfn/sentry file but make sure that the final name is still master_ssfn. Then edit users.json, pretty straight-forward.. its like with other scripts.
  139. Edit exchange.js and replace all urls you find there with your own url.
  140. Now upload the bot folder contents to /home/www/tradescript_bot. To make sure that the bot will keep running install forever.
  141.  
  142. npm install -g forever
  143. Now you can start the bot forever like so (if you are in the folder)
  144.  
  145. forever start exchange.js
  146. or (if you are not in the folder)
  147.  
  148. forever start /home/www/tradescript_bot/exchange.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement