Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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/
- Instructions:
- Install: nginx, php, mysql
- Source - https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04
- Nginx
- sudo apt-get update
- sudo apt-get install nginx
- MySQL
- Don't forget the password you set during the installation.
- sudo apt-get install mysql-server
- sudo mysql_install_db
- sudo mysql_secure_installation
- PHP
- This part is different to the Source. Copy from here.
- sudo apt-get install php5-fpm php5-mysql php5-mcrypt
- CURL
- This part is different to the Source. Copy from here.
- sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
- sudo php5enmod curl
- sudo service php5-fpm restart
- Configuring Nginx + Uploading the files and config
- I personally use vim (sudo apt-get install vim) but you can use any linux editor. (nano etc..)
- vim /etc/nginx/sites-available/default
- 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.
- server {
- listen 80;
- server_name yourdomain.com;
- root /home/www/tradescript/public;
- index index.php index.html index.htm;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- location ~ \.php$ {
- try_files $uri /index.php =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_connect_timeout 60;
- fastcgi_send_timeout 180;
- fastcgi_read_timeout 180;
- fastcgi_buffer_size 128k;
- fastcgi_buffers 256 16k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_max_temp_file_size 0;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- #fastcgi_read_timeout 200;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- }
- Then press ESC and CTRL + Z (press Z twice). This saves the file.
- Restart nginx again
- sudo service nginx restart
- Now we need to create the folder where to upload the files.
- mkdir -p /home/www/tradescript
- Upload website folder files to /home/www/tradescript. Once the upload has finished we need to chmod the storage folder.
- chmod -R 777 /home/www/tradescript/storage
- Now we need to edit the .env file because the website will not work otherwise..
- vim /home/www/tradescript/.env
- 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.
- BOT_STEAMID=botsteamid
- BOT_URL_OR_IP=85.85.85.85:1337/
- STEAM_API_KEY=your_steam_api_key
- BACKPACKTF_APIKEY=backpack_tf_api_key
- MODIFIER_KEY_USER=1
- MODIFIER_KEY_BOT=1.05
- MODIFIER_KNIFE_USER=0.93
- MODIFIER_KNIFE_BOT=0.96
- MODIFIER_WEAPON_USER=0.83
- MODIFIER_WEAPON_BOT=0.89
- MODIFIER_OTHER_USER=0.80
- MODIFIER_OTHER_BOT=0.86
- MODIFIER_TRASH_USER=0.28
- MODIFIER_TRASH_BOT=0.5
- MODIFIER_SOUVENIR_USER=0.01
- MODIFIER_SOUVENIR_BOT=0.2
- APP_URL=http://yourdomain.com
- DB_HOST=127.0.0.1
- DB_DATABASE=exchange
- DB_USERNAME=root
- DB_PASSWORD=password
- Then press ESC and CTRL + Z (press Z twice). This saves the file.
- Uploading the MySQL database
- Upload exchange.sql to /home. Then we create the database and upload data.
- mysql -u root -p
- A password prompt will appear, enter your MySQL root password. Then you should see something like this mysql> now enter this command
- CREATE DATABASE IF NOT EXISTS exchange;
- exit
- Now lets upload the exchange.sql file to the database. There will be a password prompt again.
- mysql -u root -p exchange < /home/exchange.sql
- The website should now be ready-to-use.
- 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.
- It would be wise to setup a cronjob for that, google about it.
- Configuring and uploading the Bot
- First we need NodeJS 0.12
- curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
- sudo apt-get install -y nodejs
- Create a diectory for the bot
- mkdir /home/www/tradescript_bot
- Configure the bot before uploading
- Go to polls folder and rename the json file according to your bots account name.
- 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.
- Edit exchange.js and replace all urls you find there with your own url.
- Now upload the bot folder contents to /home/www/tradescript_bot. To make sure that the bot will keep running install forever.
- npm install -g forever
- Now you can start the bot forever like so (if you are in the folder)
- forever start exchange.js
- or (if you are not in the folder)
- forever start /home/www/tradescript_bot/exchange.js
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement