Advertisement
Guest User

Untitled

a guest
Mar 5th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 15.04 KB | None | 0 0
  1. <html>
  2.         <head>
  3.        
  4.         </head>
  5.         <body>
  6.                 <h1>eBot installation instructions</h1>
  7.                 <i>
  8.                         These instructions are written for Ubuntu 14.<br>
  9.                         It might be possible to use these instructions on other Linux distribution and with some googling you could also use these for windows. <br>
  10.                         Altough the commands would be different and there might be different software needed.
  11.                 </i>
  12.                 <ul style="list-style-type:none">
  13.                 <li>
  14.                         <h2>eBot part</h2>
  15.                         <i>the eBot part is responsible for the communication with the database, the csgo server and the website.</i><br>
  16.                         <ul style="list-style-type:none">
  17.                         <li>
  18.                                 <h3>first</h3>
  19.                                 <p>apt-get update
  20. apt-get install autoconf
  21. apt-get install gcc
  22. apt-get install libcurl4-openssl-dev pkg-config
  23. apt-get install libxml2-dev
  24. apt-get install libbz2
  25. apt-get install libbz2-dev
  26. apt-get install libpng-dev</p>
  27.                                 <h3>php</h3>
  28.                                 <ol>
  29.                                         <li>
  30.                                                 Check your php build options:
  31.                                                         <ol>
  32.                                                                 <li>
  33.                                                                         <b>"php -i | grep enable-maintainer-zts".</b>
  34.                                                                 </li>
  35.                                                                 <li>
  36.                                                                         if there's a line like this in the output <b>"Configure Command =>  './configure'  '--with-config-file-path=/etc/php5/apache2' '--with-pear=/usr/share/php' '--with-bz2' '--with-curl' '--with-gd' '--enable-calendar' '--enable-mbstring' '--enable-bcmath' '--enable-sockets' '--with-libxml-dir=/usr' '--with-mysqli' '--with-mysql' '--with-openssl' '--with-regex=php' '--with-zlib' '--enable-debug' '--enable-maintainer-zts'
  37.                                                                         "</b> you can continue to the next step otherwise read the part about recompiling php.
  38.                                                                 </li>
  39.                                                         </ol>
  40.                                         </li>
  41.                                         <li>
  42.                                                 Install pthreads:
  43.                                                 <ol>
  44.                                                         <li>
  45.                                                                 <b>"pecl install pthreads"</b>
  46.                                                         </li>
  47.                                                         <li>
  48.                                                                 Find your php configuration file<br>
  49.                                                                 <b>"php -i | grep Loaded"</b><br>
  50.                                                                 and look for the line "Loaded Configuration File => "
  51.                                                         </li>
  52.                                                         <li>
  53.                                                                 Add the extensioin to the configuration to config file:<br>
  54.                                                                 <b>"echo extension=pthreads.so" >> [the location of your php configuration file ex:(/etc/php.ini)]"</b>
  55.                                                         </li>
  56.                                                         <li>
  57.                                                                 Reboot your pc<br>
  58.                                                                 <b>"reboot"</b>
  59.                                                         </li>
  60.                                                         <li>
  61.                                                                 Check if pthread is installed correctly:<br>
  62.                                                                 <b>"php -m | grep pthreads"</b>
  63.                                                         </li>
  64.                                                 </ol>
  65.                                         </li>
  66.                                 </ol>
  67.                                 recompiling php(only if step 1 failed)
  68.                                 <ol>
  69.                                         <li>
  70.                                                 Make the php folder:
  71.                                                 <ol>
  72.                                                         <li>
  73.                                                                 <b>"mkdir /var/php"</b>
  74.                                                         </li>
  75.                                                         <li>
  76.                                                                 <b>"cd /var/php"</b>
  77.                                                         </li>
  78.                                                 </ol>
  79.                                         </li>
  80.                                         <li>
  81.                                                 Download the latest php source code:<br>
  82.                                                 <ol>
  83.                                                         <li>
  84.                                                                 <b>"wget http://www.php.net/distributions/php-&ltversion&gt.tar.gz"</b><br>
  85.                                                                (ex: wget http://www.php.net/distributions/php-5.5.8.tar.gz )
  86.                                                        </li>
  87.                                                        <li>
  88.                                                                <b>"tar -zxvf php-&ltversion&gt.tar.gz"</b><br>
  89.                                                        </li>
  90.                                                        <li>
  91.                                                                <b>"cd php-&ltversion&gt"</b>
  92.                                                        </li>
  93.                                                </ol>
  94.                                        </li>
  95.                                        <li>
  96.                                                run the configure command to configure the make file<br>
  97.                                                <b>"./configure --with-config-file-path=/etc/php5/apache2 --with-pear=/usr/share/php --with-bz2 --with-curl --with-gd --enable-calendar --enable-mbstring --enable-bcmath --enable-sockets --with-libxml-dir=/usr --with-mysqli --with-mysql --with-openssl --with-regex=php --with-zlib --enable-debug --enable-maintainer-zts "</b>  
  98.                                        </li>
  99.                                        <li>
  100.                                                Compile php:<br>
  101.                                                <b>"make"</b>
  102.                                        </li>
  103.                                        <li>
  104.                                                Test the compiled version:<br>
  105.                                                <b>"make test"</b>
  106.                                        </li>
  107.                                        <li>
  108.                                                Install your new compiled php version<br>
  109.                                                <b>"make install"</b>
  110.                                        </li>
  111.                                        <li>
  112.                                                Test if the php version is installed correctly<br>
  113.                                                <b>"php -v"</b> Check if the built time is now
  114.                                        </li>
  115.                                </ol>
  116.                        </li>
  117.                        <li>
  118.                                <h3>nodeJs</h3>
  119.                                                Install nodeJs:
  120.                                                <ol>
  121.                                                        <li>
  122.                                                                <b>"apt-get install nodejs"</b>
  123.                                                        </li>
  124.                                                        <li>
  125.                                                                <b>"apt-get install npm"</b>
  126.                                                        </li>
  127.                                                        <li>
  128.                                                                <b>"npm install archiver formidable socket.io"</b>
  129.                                                        </li>
  130.                                                </ol>
  131.                                        </li>
  132.                                </ol>
  133.                        </li>
  134.                        <li>
  135.                                <h3>Get the eBot </h3>
  136.                                        <li>
  137.                                                Make the eBot folder:
  138.                                                        <ol>
  139.                                                                <li>
  140.                                                                        <b>"mkdir /var/eBotv3"</b>
  141.                                                                </li>
  142.                                                                <li>
  143.                                                                        <b>"cd /var/eBotv3"</b>
  144.                                                                </li>
  145.                                                        </ol>
  146.                                        </li>
  147.                                        <li>
  148.                                        Download the latest eBot version from github <br>
  149.                                                <b>"wget https://github.com/deStrO/eBot-CSGO/archive/threads.zip"</b>
  150.                                        </li>
  151.                                        <li>
  152.                                                Unzip the file: <br>
  153.                                                <b>"unzip eBot-CSGO-threads.zip -d /var/eBotv3"</b>
  154.                                        </li>
  155.                                </ol>
  156.                        </li>
  157.                        <li>
  158.                                <h3>Composer</h3>
  159.                                        Install composer:
  160.                                        <b>"php -r "readfile('https://getcomposer.org/installer');" | php"</b>
  161.                         </li>
  162.                         <li>
  163.                                 <h3>Install the eBot</h3>
  164.                                 <ol>
  165.                                         <li>
  166.                                                 Install the bot:<br>
  167.                                                 <b>"php composer.phar install"</b>
  168.                                         </li>
  169.                                         <li>
  170.                                                 Configure the bot:<br>
  171.                                                 edit the bot ip in the config file: config/config.ini<br>
  172.                                                 make sure the bot ip is the same as your external ip.<br>
  173.                                                 you can find yours at <a href="http://www.whatsmyip.org/">http://www.whatsmyip.org/</a><br>
  174.                                         </li>
  175.                                         <li>
  176.                                                 Test if everything is working alright<br>
  177.                                                 <b>"php bootstrap.php"</b>
  178.                                         </li>
  179.                                 </ol>
  180.                         </li>
  181.                         <li>
  182.                                 <h3>extra backup security</h3>
  183.                                 <i>
  184.                                 the website part tends to crash sometimes<br>
  185.                                 so i've developed a script that checks if the bot is still running and if not it starts it again<br>
  186.                                 the installation of this is not necessary
  187.                                 </i>
  188.                                 <ol>
  189.                                         <li>
  190.                                                 make the script:<br>
  191.                                                 <b>"touch /var/eBotv3/eBotScript.sh"</b>
  192.                                         </li>
  193.                                         <li>
  194.                                                 make sure the script is executable:<br>
  195.                                                 <b>"chmod +x /var/eBotv3/eBotScript.sh"</b>
  196.                                         </li>
  197.                                         <li>
  198.                                                 add the script to the file:<br>
  199.                                                 paste this in the file<br>
  200.                                                 <i>
  201.                                                 #!/bin/bash<br>
  202.                                                 pidof  php /var/eBotv3/bootstrap.php >/dev/null<br>
  203.                                                 if [[ $? -ne 0 ]] ; then<br>
  204.                                                         &nbsp;&nbsp;&nbsp;&nbsp;echo "Restarting eBot bootstrap.php:     $(date)" >> /var/log/eBotServer.log<br>
  205.                                                         &nbsp;&nbsp;&nbsp;&nbsp;pkill node<br>
  206.                                                         &nbsp;&nbsp;&nbsp;&nbsp;screen -dmS ebotv3 php /var/eBotv3/bootstrap.php &<br>
  207.                                                fi<br>
  208.                                                sleep 1<br>
  209.                                                pidof  node /var/eBotv3/websocket_server.js 192.210.137.227 12360 >/dev/null<br>
  210.                                                if [[ $? -ne 0 ]] ; then<br>
  211.                                                         &nbsp;&nbsp;&nbsp;&nbsp;echo "Restarting eBot websocket:     $(date)" >> /var/log/eBotServer.log<br>
  212.                                                         &nbsp;&nbsp;&nbsp;&nbsp;screen -dmS websocket node /var/eBotv3/websocket_server.js 192.210.137.227 12360 & <br>
  213.                                                fi<br>
  214.                                                </i>
  215.                                        </li>
  216.                                        <li>
  217.                                                Let it execute every minute:<br>
  218.                                                <b>"(crontab -l ; echo "*/1 * * * * /var/eBotv3/eBotScript.sh")| crontab -"</b>
  219.                                         </li>
  220.                                 </ol>
  221.                         </li>
  222.                         </ul>
  223.                 </li>
  224.         </body>
  225. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement