This little project took me about 25 hours, because of a lot of debugging and very little documentation for error messages regarding eBot. With this tutorial I will hopefully help someone else (and future me) to do this in 1-2 hours instead 🙂
- Ubuntu 16.04 running as a VM in ESXi 6
- eBot v3.1
My local IP for the server is 192.168.2.101. Remember to change it with your own server IP. Most of this guide also uses default config, and has not been optimized.
I also recommend to read the sources I have added, as they helped me a lot, so all credits to them. They could also help you if I forgot something in this article.
Update 24.10.2016: I recorded a video with installing Ubuntu, CS:GO server (with LGSM) and eBot.
I will not include install of Ubuntu in this tutorial. I just installed a default Ubuntu server with SSH server and LAMP package.
Ubuntu and CS takes about 18 GB, so make sure to allocate enough space for future updates and logs.
If you are using a template server or something from a hosting company, you are probably are connected with SSH already. If so, just jump to «Update» before installing CS:GO.
I usually like to change the SSH port for some extra security, and allow root login to make it more simple.
sudo vi /etc/ssh/sshd_config
(WARNING: Allow root login is not best practice, but I like to have full and easy access when testing and debugging:-) PermitRootLogin should only be enabled in the setup-process, demo environment or home/private network…)
Set a password for root-user
sudo passwd root
*Set password for root*
Restart SSH service
sudo service ssh restart
Now connect with SSH (putty?).
I disabled my firewall to prevent any problems with blocked ports, do NOT do this on a public server. See documentation to open ports. You should most likely open port 27015 for CS (if using default) and 12360 for eBot (can be changed in config).
Make sure server is up to date
apt-get update && apt-get upgrade
Install Counter Strike: GO dedicated server
Update 25.10.2016: The guide below shows how to install a CS:GO server from scratch (to original way). In my last setups I have started to use Linux Game Server Managers (LGSM) instead. You can look at it here: https://gameservermanagers.com/. I also use LGSM in my video-tutorial at the top of the article. If you use LGSM to install the server, you can just jump to the eBot part after the server is up and running.
apt-get install nano wget tar lib32gcc1
Add a local steam user to the Ubuntu-server
adduser --disabled-login --disabled-password steam
Just add name, room, etc. blank – and enter “Y” at the end.
Install the gameserver
cd /home/steam/ su - steam wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz tar xvf steamcmd_linux.tar.gz rm steamcmd_linux.tar.gz ./steamcmd.sh
Now you should be running the steamcmd, you should see «Steam>» when entering the command.
login anonymous force_install_dir ./csgo app_update 740 validate
It will look something like this:
Steam>login anonymous Connecting anonymously to Steam Public...Logged in OK Waiting for license info...OK Steam>force_install_dir ./csgo Steam>app_update 740 validate Update state (0x3) reconfiguring, progress: 0.00 (0 / 0) Error! App '740' state is 0x202 after update job. Steam>app_update 740 validate Update state (0x5) validating, progress: 5.24 (833131281 / 15885781951) Update state (0x61) downloading, progress: 0.01 (2245082 / 15885781951) Update state (0x61) downloading, progress: 0.18 (28943373 / 15885781951) …
Error! App ‘740’ state is 0x202 after update job.
Solution: Just try again.
Error! App ‘740’ state is 0x602 after update job.
Solution: Ran out of diskspace on server. I was working on a VirtualMachine, so I just booted from Ubuntu Desktop Live CD, started gparted and expanded the disk. Just Google if you need to do this.
hostname "SERVER-HOSTNAME" sv_password "SERVER-PASSWORD" sv_timeout 60 rcon_password "RCON-PASSWORD" mp_autoteambalance 1 mp_limitteams 1 writeid writeip
Create a service
If you are putting the server on the Internet (not LAN), you need to request the GSLT key from Steam, on the Game Server Account Management. I used the app-ID 730 for CS:GO, but installed app-ID 740 above, I’m not sure if there is a difference, but it worked for me.
You can find the command line options on this page. You should configure the start parameters for your own needs. The example below is copied from the tutorial in sources and are missing IP that can give an eBot error. I have included my working config at the end.
[Unit] Description=CSGO Server [Service] Type=simple User=steam Group=steam Restart=on-failure RestartSec=5 StartLimitInterval=60s StartLimitBurst=3 ExecStart=/home/steam/csgo/srcds_run srcdds -game csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount [YOUR_GSLT] -net_port_try 1 ExecStop=killall -TERM srcds_linux [Install] WantedBy=multi-user.target systemctl --system daemon-reload systemctl start csgo.service systemctl enable csgo.service systemctl status csgo.service
Using eBot version 3.1 (both bot and web).
eBot has three parts:
Collects data from the game and communicate with RCON.
Panel / Website
Web-page – allows you to create matches, control them and see stats.
Gameserver / addon
CSay and allows eBot to communicate in the in-game chat.
apt-get install apache2 gcc make libxml2-dev autoconf ca-certificates unzip nodejs curl libcurl4-openssl-dev pkg-config libssl-dev screen
I assume you have installed the LAMP package (apache2, MySQL and PHP) when you installed the server. If not, you have to install apache2 and MySQL by yourself (Google it or see this guide for eBot).
PHP in the other hand, we actually should remove – because we need a lower version and we need to compile in pthreads. I didn’t want to take the chance of removing my php packages, as there is no direct uninstaller – so I just installed the old PHP over the previous one with the steps below.
Compile and install PHP
mkdir /home/install cd /home/install wget http://be2.php.net/get/php-5.5.15.tar.bz2/from/this/mirror -O php-5.5.15.tar.bz2 tar -xjvf php-5.5.15.tar.bz2 cd php-5.5.15 ./configure --prefix /usr/local --with-mysql --enable-maintainer-zts --enable-sockets --with-openssl --with-pdo-mysql make make install cd /home/install wget http://pecl.php.net/get/pthreads-2.0.7.tgz tar -xvzf pthreads-2.0.7.tgz cd pthreads-2.0.7 /usr/local/bin/phpize ./configure make make install echo 'date.timezone = Europe/Paris' >> /usr/local/lib/php.ini echo 'extension=pthreads.so' >> /usr/local/lib/php.ini
Install eBot – bot
mkdir /home/ebot cd /home/ebot wget https://github.com/deStrO/eBot-CSGO/archive/master.zip unzip master.zip mv eBot-CSGO-master ebot-csgo cd ebot-csgo curl --silent --location https://deb.nodesource.com/setup_0.12 | bash - apt-get install -y nodejs
If using Ubuntu 16 as me, you probably need to write apt-get install nodejs-legacy and apt-get install npm. You would most likely get an error for the nodejs package.
npm install firstname.lastname@example.org archiver formidable curl -sS https://getcomposer.org/installer | php php composer.phar install cp config/config.ini.smp config/config.ini
The steps above are critical to get eBot to communicate over socket.io. Please check the feedback to see that everything was installed OK. I had some problems with nodejs and npm while using the tutorial i followed.
Install eBot – web
cd /home/ebot rm -R master* wget https://github.com/deStrO/eBot-CSGO-Web/archive/master.zip unzip master.zip mv eBot-CSGO-Web-master ebot-web cd ebot-web cp config/app_user.yml.default config/app_user.yml
Edit config files
I have added my working config-files at the bottom.
(If you used net, don’t put localhost or 127.0.0.1 here. It will not work. You need to put your server IP)
mode: net (for Internet, or LAN for local)
Set access and user to database, to allow you to login on the eBot web-page
mkdir /home/ebot/ebot-web/cache chown -R www-data * chmod -R 0777 /home/ebot/ebot-web/cache php symfony cc php symfony doctrine:build --all --no-confirmation php symfony guard:create-user --is-super-admin admin@ebot admin admin
Adding www-data group to the /home/ebot/ebot-web/ is important, if not, the apache can’t access the webpage files and you will get a forbidden error.
I’m not used to the chown-syntax above, so I used chown -R user:www-data /home/ebot/ebot-web/, where you set user to root or the user you created on install.
If the php sumfony steps fail, you will not be able to login on the eBot webpage.
Alias / /home/ebot/ebot-web/web/ <Directory /home/ebot/ebot-web/web/> AllowOverride All <IfVersion < 2.4> Order allow,deny allow from all </IfVersion> <IfVersion >= 2.4> Require all granted </IfVersion> </Directory>
(I tried to set alias to /ebot istead of just /, but it looks like the web-path is hard-coded somewhere, giving a load error for images and files in the browsers console.)
I changed to a public subdomain after, with this config:
<VirtualHost *:80> #Edit your email ServerAdmin email@example.com #Edit your sub-domain ServerAlias ebot.mydomain.no DocumentRoot /home/ebot/ebot-web/web <Directory /home/ebot/ebot-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>
Enable the site / URL:
a2enmod rewrite a2ensite ebotv3.conf service apache2 reload
You should now be able to open the eBot webpage and log in. You will probably get a socket error or something before you run eBot (next step).
(See troubleshooting at the end of the article if you get error «Forbidden», or if you get 500 error on the admin.php)
If all works, it should be able to see green status messages in the sidebar. If not, just continue and look at the Troubleshoot section in the end of this article.
Create startup script
cd /home/install wget https://raw.githubusercontent.com/vince52/eBot-initscript/master/ebotv3; mv ebotv3 /etc/init.d/ebot && chmod +x /etc/init.d/ebot /etc/init.d/ebot start
You can also write /etc/init.d/ebot restart|stop|status.
Install CSay addon to CS server
I recommend going to http://www.esport-tools.net/ebot/requirements, and click on the green label CS:GO under Gameserver part – to download it.
Here is the direct download link (but it could get out of date as this article gets older): http://www.esport-tools.net/download/CSay-CSGO.zip
- Download CSay addon to your computer
- Extract the .zip file
- Upload the «addon» folder under /home/steam/csgo/csgo/ on your server.
I used WinSCP to upload the files.
The addon folder probably doesn’t exist in /home/steam/csgo/csgo/ before you upload it.
It should be loaded automatically, but recommend to write «service csgo restart» or restart the server.
The reason for allowing root login at the start of this article, is to get full access with WinSCP. If you don’t have access to upload the folder, you need to change the user in SSH with chown.
If you started the service you created above, the eBot should be running. But by running the bootstrap.php, you will get a log of what is happening.
| _ \ | | ___| |_) | ___ | |_ / _ \ _ < / _ \| __| | __/ |_) | (_) | |_ \___|____/ \___/ \__| PHP Compatibility Test ----------------------------------------------------- | PHP 5.3.1 or newer -> required -> [ Yes ] 7.0.8-0ubuntu0.16.04.2 | Standard PHP Library -> required -> [ Yes ] | MySQL -> required -> [ No ] | Sockets -> required -> [ Yes ] | pthreads -> required -> [ No ] -----------------------------------------------------
The first time I got error on MySQL and pthreads. The PHP version was also PHP 7 and is not working with eBot at the moment.
After restart of the server all changed to YES, and the php version changed down to 5.5.
| _ \ | | ___| |_) | ___ | |_ / _ \ _ < / _ \| __| | __/ |_) | (_) | |_ \___|____/ \___/ \__| PHP Compatibility Test ----------------------------------------------------- | PHP 5.3.1 or newer -> required -> [ Yes ] 5.5.15 | Standard PHP Library -> required -> [ Yes ] | MySQL -> required -> [ Yes ] | Sockets -> required -> [ Yes ] | pthreads -> required -> [ Yes ] ----------------------------------------------------- | Registerung Shutdown function ! | Starting eBot Websocket-Server ! Notice: Undefined index: WORKSHOP in /home/ebot/ebot-csgo/src/eBot/Config/Config.php on line 62 | WebSocket server crashed
But still some problems after the restart… «Websocket server crashed».
The IP should be the same in most config files. Trying and failing IP-addresses in the different config files was probably the most time-consuming in my case. Should I use 127.0.0.1 as I hosted all on the same server? or the LAN IP? Or the public IP, as my server was public?
I also had different errors and some weird stuff happening between restarts, my conclusion is that some of the config is not reloaded properly. So remember, restart could help 🙂
Here are my current working config
hostname "VisionLAN Test" sv_password "123" sv_timeout 60 rcon_password "123" mp_autoteambalance 1 mp_limitteams 1 cl_cmdrate 128 cl_updaterate 128 rate 128000 writeid writeip log on logaddress_add 127.0.0.1:12360 sv_log_onefile "0" sv_logbans "1" sv_logecho "1" sv_logfile "1" sv_logflush "0" sv_logsdir "0"
[Unit] Description=CSGO Server [Service] Type=simple User=steam Group=steam Restart=on-failure RestartSec=5 StartLimitInterval=60s StartLimitBurst=3 ExecStart=/home/steam/csgo/srcds_run srcdds -game csgo -console -tickrate 128 -usercon +sv_logecho 1 +net_public_adr <ACTUAL_PUBLIC_IP> +ip 0.0.0.0 +game_type 0 +game_mode 1 -hostport 27015 +mapgroup mg_active +map de_dust2 +sv_setsteamaccount <STEAM_SERVER_KEY> -net_port_try 1 ExecStop=killall -TERM srcds_linux [Install] WantedBy=multi-user.target
# You can find more information about this file on the symfony website: # http://www.symfony-project.org/reference/1_4/en/07-Databases all: doctrine: class: sfDoctrineDatabase param: dsn: mysql:host=127.0.0.1;dbname=ebotv3 username: ebotv3 password: VisionLAN
# ---------------------------------------------------------------------- # white space are VERY important, don't remove it or it will not work # ---------------------------------------------------------------------- log_match: ../../ebot-csgo/logs/log_match log_match_admin: ../../ebot-csgo/logs/log_match_admin demo_path: ../../ebot-csgo/demos # true or false, whether demos will be downloaded by the ebot server # the demos can be downloaded at the matchpage, if it's true demo_download: false ebot_ip: 192.168.2.101 ebot_port: 12360 # lan or net, it's to display the server IP or the GO TV IP # net mode display only started match on home page mode: net # set to 0 if you don't want a refresh refresh_time: 30
; eBot - A bot for match management for CS:GO ; @license http://creativecommons.org/licenses/by/3.0/ Creative Commons 3.0 ; @author Julien Pardons <firstname.lastname@example.org> ; @version 3.0 ; @date 21/10/2012 [BDD] MYSQL_IP = "127.0.0.1" MYSQL_PORT = "3306" MYSQL_USER = "ebotv3" MYSQL_PASS = "VisionLAN" MYSQL_BASE = "ebotv3" [Config] BOT_IP = "192.168.2.101" BOT_PORT = 12360 MANAGE_PLAYER = 1 DELAY_BUSY_SERVER = 120 NB_MAX_MATCHS = 0 PAUSE_METHOD = "nextRound" ; nextRound or instantConfirm or instantNoConfirm [Match] LO3_METHOD = "restart" ; restart or csay or esl KO3_METHOD = "restart" ; restart or csay or esl DEMO_DOWNLOAD = true ; true or false :: whether gotv demos will be downloaded from the gameserver after matchend or not REMIND_RECORD = false ; true will print the 3x "Remember to record your own POV demos if needed!" messages, false will not DAMAGE_REPORT = true; true will print damage reports at end of round to players, false will not [MAPS] MAP = "de_dust2_se" MAP = "de_nuke_se" MAP = "de_inferno_se" MAP = "de_mirage_ce" MAP = "de_train_se" MAP = "de_cache" MAP = "de_season" MAP = "de_dust2" MAP = "de_nuke" MAP = "de_inferno" MAP = "de_train" MAP = "de_mirage" MAP = "de_cbble" MAP = "de_overpass" [WORKSHOP IDs] [Settings] COMMAND_STOP_DISABLED = false RECORD_METHOD = "matchstart" ; matchstart or knifestart DELAY_READY = true
Your own config (cfg) in eBot
Update 11.10.2016: If you want to run your own config with eBot, you can write the name of the config-file when creating a match (without the .cfg extenion). This cfg-file should be located under the default csgo/cfg folder in your CS Server installation.
I have noticed some other problems, if the .cfg is also set in the startparameters of CS:GO, there can be some issues when loading the config on knife- and matchround. So make sure to create a brand new .cfg file only for use with eBot.
When I used csgo-server.cfg in both startparameters and in the eBot match, the kniferound didn’t get rid of the guns and match-rounds didn’t execute things like mp_roundtime. Not sure why… It all started working fine when I created a new single competative .cfg file for the eBot to load.
The other problem was with the freeze-time, if the game-mode was not set to competitive. I have only seen this option in the config for gameservermanagers.com so far – not sure if this is an issue on a clean install from Valve.
Troubleshooting and debugging
Push F12 to get the developer console in the browser. Works in most browsers, but I like Google Chrome.
If Websocket is not avalible, it will say Loading in the sidebar and you would get a connection error in the console.
In my case it took some time to figure out what and how the connection was made. I was debugging firewall-log and more. I think the problem was what IP to use. 127, 192 or the public IP.
I tested by creating multiple servers.
When running the bootstrap.php I could see what was going on…
LOG: 2016-09-03 01:34:32 - ERROR [eBot\Match\Match] Rcon failed - Can't auth to rcon 192.168.1.101:27015 (Network is unreachable (Code: 101)) 2016-09-03 01:34:45 - ERROR [eBot\Match\Match] Rcon failed - Can't auth to rcon <PUBLIC IP>:27015 (Operation now in progress (Code: 115)) 2016-09-03 01:34:51 - ERROR [eBot\Match\Match] Rcon failed - Can't auth to rcon 127.0.0.1:27015 (Connection refused (Code: 111))
I changed the IP in the start parameters for CS:GO (/lib/systemd/system/csgo.service) and it started working.
But then got a whole lot of other error messages. It looked like the CounterStrike client could talk back to the eBot.
2016-09-03 05:21:12 - ERROR [eTools\Rcon\CSGO] Error while doing csay_all "eBot: Warmup Knife Round - Team1 (CT) VS (T) Team2." Broken pipe (Code: 32) 2016-09-03 05:21:15 - ERROR [eTools\Rcon\CSGO] Error while doing echo eBot Broken pipe (Code: 32) 2016-09-03 15:14:24 - ERROR [eTools\Rcon\CSGO] Error while doing csay_all "eBot: Warmup Knife Round - Team1 (CT) VS (T) Team2." Not authenticated yet. PuTTYPuTTY2016-09-03 15:14:32 - ERROR [eTools\Rcon\CSGO] Error while doing csay_all "eBot: Please write !ready when your team is ready!" Not authenticated yet. 2016-09-03 15:14:33 - ERROR [eTools\Rcon\CSGO] Error while doing echo eBot Not authenticated yet. 2016-09-03 15:15:55 - ERROR [eTools\Rcon\CSGO] Error while doing exec server.cfg You have been banned from this server. 2016-09-03 15:15:56 - ERROR [eTools\Rcon\CSGO] Error while doing mp_teamname_1 ""; mp_teamname_2 ""; mp_teamflag_1 ""; mp_teamflag_2 "" The operation timed out.
As CS:GO and eBot was on the same server, I changed almost all IP-addresses in the config files to my local IP (192…). I usually set 127.0.0.1 if it’s the same host. The default config also used 127 – but that didn’t work so well in my case.
After changing most of my IP-addresses to the 192 address, everything started working. But I probably had to restart the server a couple of times due to some reload config bug – or I am just missing a service or something to restart/reload.
See my config files above to see where I added my local IP-address.
File access, Apache forbidden…
Another possible error-source could be file access. E.g. if you get «Forbidden» in Apache, then the apache does not have access to the eBot web-files.
Change myuser with your username.
chown -R myuser:www-data /home/ebot/ebot-web/ chmod -R 0775 /home/ebot/ebot-web/
If eBot webpage is working, but you get an 500 error when opening /admin.php.
Check the apache log.
tail -f /var/log/apache2/access.log
tail parameter is to get the bottom of the log, and -f parameter is to follow the log. Push CTRL+C to quit.
In the access log I could see the same as in the browser. The request had an 500 error.
IP_ADDRESS - - [04/Sep/2016:12:07:17 -0500] "GET /admin.php HTTP/1.1" 500 185 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36"
So i checked the error.log:
tail -f /var/log/apache2/error.log
[Sun Sep 04 12:03:06.262500 2016] [:error] [pid 18656] [client 126.96.36.199:53422] PHP Fatal error: Uncaught sfCacheException: Failed to make cache directory "/home/ebot/ebot-web/cache/backend/prod/config" while generating cache for configuration file "config/config_handlers.yml". in /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php:340\nStack trace:\n#0 /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php(110): sfConfigCache->writeCacheFile('config/config_h...', '/home/ebot/ebot...', '<?php\\n// auto-g...')\n #1 /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php(197): sfConfigCache->callHandler('config/config_h...', Array, '/home/ebot/ebot...')\n #2 /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php(279): sfConfigCache->checkConfig('config/config_h...')\n #3 /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php(54): sfConfigCache->loadConfigHandlers()\n #4 /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php(197): sfConfigCache->callHandler('config/core_com...', Array, '/home/ebot/ebot.. in /home/ebot/ebot-web/lib/vendor/symfony/lib/config/sfConfigCache.class.php on line 340
It’s a lot of text, but if you look for the sentences, and not the file paths, you can see «Failed to make cache directory».
I probably forgot to create the cache directory, created it in the wrong folder or just forgot to set correct access to it.
mkdir /home/ebot/ebot-web/cache/ chmod -R 0777 /home/ebot/ebot-web/cache/
If you get really annoyed and nothing is working, you could do…
chmod -R 0777 /home/ebot/ chmod -R 0777 /home/steam/
…then there is nothing stopping access to the files. But this is also a security risk! I was testing on a virtual machine for testing purposes, but don’t do stuff like this if you still have some hope to get it working 🙂