Advertisement
Guest User

Untitled

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