Linux

This guide will explain how to install eBot only on Debian/Ubuntu.

If you don't want to follow all of these steps, you can simply run this:

apt install git
git clone https://github.com/Flegma/ebot-cs2-install-script.git ebot-cs2-install
cd ebot-cs2-install
chmod +x ebot-cs2-install.sh
./ebot-cs2-install.sh

Requirements

Before beginning the setup, make sure you have updated your packages (apt update) and installed recommended packages.

apt update
apt upgrade
apt-get install -y language-pack-en-base software-properties-common nano wget curl git unzip snapd screen

Nginx / Apache

You can use the web server you want, it doesn't matter.

Nginx
apt-get install -y nginx-full
Apache2
apt-get install -y libapache2-mod-php7.4 apache2

Node.js

You must install the LTS version of Node.js to run eBot.

I recommend using NVM to install the LTS version. NVM allows users to quickly switch between different Node.js versions.

Alternatively, you can use the package manager:

apt-get install -y nodejs

Once Node.js has been installed, run:

npm install -g yarn

PHP

As eBot runs on PHP, you will need to install exactly PHP-7.4.

We recommend using sury.org packages to install this specific PHP version:

add-apt-repository ppa:ondrej/php -y
apt-get install -y php7.4-fpm php7.4-redis php7.4-cgi php7.4-cli php7.4-dev php7.4-bcmath php7.4-bz2 php7.4-common php7.4-curl php7.4-intl php7.4-mbstring php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-zip php7.4-opcache php7.4 php7.4-xsl

eBot requires composer, the plugins manager for PHP. To add it, run this:

wget https://getcomposer.org/composer-2.phar
chmod +x composer-2.phar
mv composer-2.phar /usr/bin/composer

MySQL

If you do not have a MySQL server set up and configured, you must install one:

apt install mysql-server 
mysqladmin -u root password "YourMysqlRootPassword"
mysql_secure_installation <<EOF
n
y
y
y
y
EOF

Create a database and user for eBot (be sure to replace the password with something more secure):

# bash will ask for your root password
mysql -u root -p
# you are now in the MySQL console
CREATE DATABASE ebotv3;
CREATE USER 'ebotv3'@'localhost' IDENTIFIED BY 'YoureBotMysqlPassword';
GRANT ALL PRIVILEGES ON $ebot_db_name.* TO 'ebotv3'@'localhost';
FLUSH PRIVILEGES;
quit;

Redis

eBot & the logs-receiver require a redis-server to dispatch the logs through a queue.

If you don't have a running redis-server, run:

apt install redis-server

eBot Installation

Now you need to choose where you will install eBot (the 3 projects).

mkdir /home/ebot
cd /home/ebot

Then we clone all repos to simplify the update process

git clone git@github.com:deStrO/eBot-CSGO.git ebot-app
git clone git@github.com:deStrO/eBot-CSGO-Web.git ebot-web
git clone git@github.com:deStrO/ebot-project.git ebot-project

Logs-receiver

The packages and ts-note must be installed to run the logs-receiver.

cd ebot-project
yarn install
npm install -g ts-node
mv configs/logs-receiver.json.sample configs/primary.json

You can edit the configs/primary.json file with your configuration if required.

To run the logs receiver, we recommend you to use screen or tmux

# from the ebot-project directory
screen -dmS ebot-logs ts-node src/logs-receiver configs/primary.json

eBot Main Application

Navigate back to the root folder of your eBot installation.

cd ebot-app
cp config/config.ini.smp config/config.ini

Now you will need to update the settings within the config/config.ini file:

  • BOT_IP : this is the listening IP for eBot (you can put 0.0.0.0 if you want to listen on all IP's)
  • MYSQL_IP/MYSQL_PORT/MYSQL_USER/MYSQL_PASS/MYSQL_BASE : adapt the configuration to match your MySQL setup
  • LOG_ADDRESS_SERVER : adapt with your server IP (LAN or Online) of the logs receiver. The default port of logs-receiver is 12345.
  • WEBSOCKET_SECRET_KEY : change this to a strong password (keep this in memory, you will need it later)

You might adapt the configuration for Redis or other configuration, but these are the configuration entries that you must adapt.

If you didn't set a Timezone in your PHP config, you must add one :

echo "date.timezone = Europe/Brussels" >> /etc/php/7.4/cli/php.ini
echo "date.timezone = Europe/Brussels" >> /etc/php/7.4/fpm/php.ini

Then you will need to install the dependencies

composer install
yarn install

eBot Web

Navigate back to the root folder of your eBot installation.

cd ebot-app
cp config/app_user.yml.default config/app_user.yml

Now you will need to update the configuration of config/app_user.yml to match the config.ini from the app.

  • log_match: ../../ebot-app/logs/log_match
  • log_match_admin: ../../ebot-app/logs/log_match_admin
  • demo_path: ../../ebot-app/demos
  • ebot_ip : the BOT_IP from config.ini or your public/lan IP of the server
  • ebot_port : same as BOT_PORT
  • websocket_secret_key : same as WEBSOCKET_SECRET_KEY

Next, set up your previously configured MySQL database information within config/database.yml

Once config/database.yml has been configured, you can run these commands:

mkdir cache
php5 symfony cc
php5 symfony doctrine:build --all --no-confirmation
php5 symfony guard:create-user --is-super-admin admin@ebot admin admin

It will create the database, and create a user with login admin and password admin. You can of course change this now or later within the web panel.

And last: you will need to configure your web-server to redirect to eBot-Web

Nginx

Here is the sample config file :

server {
        listen 80 ;

        server_name localhost;

        root /home/ebot/ebot-web/web;

       location ~ .php($|/) {
                set $script $uri;
                set $path_info "";

                if ($uri ~ "^(.+.php)(/.+)") {

                        set $script $1;
                        set $path_info $2;
                }
                fastcgi_split_path_info ^(.+.php)(/.+)$;
                include fastcgi_params;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                fastcgi_param HTTPS off;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param SCRIPT_NAME $fastcgi_script_name;
                fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
                fastcgi_read_timeout 120;
        }

        location / {
                index index.php;
                try_files $uri /index.php?$args;
        }

        error_log /var/log/nginx/ebot_error.log;
        access_log /var/log/nginx/ebot_access.log;
}

Depending on your needs, replace the default.conf under /etc/nginx/sites-enabled or create a new one (but change the server_name) and then:

service nginx restart

Apache

Here is the sample config file for apache

<VirtualHost *:80>
    ServerAlias localhost
    DocumentRoot /home/ebot/ebot-cs2-web/web
    <Directory /home/ebot/ebot-cs2-web/web/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        <IfVersion < 2.4>
            Order allow,deny
            allow from all
        </IfVersion>
        <IfVersion >= 2.4>
            Require all granted
        </IfVersion>
    </Directory>
</VirtualHost>

Place the file under /etc/apache2/sites-available/ebotcs2.conf and then

a2enmod rewrite
a2ensite ebotcs2.conf
service apache2 restart

The eBot panel will be accessible from http://ipordomain/ and http://ipordomain/admin.php

Start eBot

To start eBot, run this from the ebot-app folder:

php bootstrap.php

You can also run it in a screen:

screen -dmS ebot-app php bootstrap.php

And then enjoy!