Good day Habra community!
After long hours of playing in BattleField 2, extended trips on tanks and jeeps, crazy helicopter crashes and a couple of hundred meters of collected statistics on all this fun, it was time to think about the terrorist situation on the gaming front. How are the hostages doing? But did the good old de_dust2 fall asleep with dust?
Today I will tell you how to install and configure the Counter-Strike 1.6 game server and attach local player statistics to it. This article is the second of the “Free Time Wars” series.
Previous articles:
BattleField 2 Ranked Server
')
Server:
HP ProLiant ML350 G5
Intel Xeon 5160
8 Gb RAM ECC
OS Ubuntu 12.04 LTS (GNU / Linux 3.2.0-23-generic x86_64)
In the last article I described where I store files for servers, but I’ll still repeat.
For my convenience, everything about the server part I store in a separate directory in the root of the system.
sudo mkdir /server cd /server sudo mkdir cs
Here in the folder cs our adventures will develop.
Web server installation, PHP, MySQL
So, let's proceed to the installation:
sudo apt-get install apache2 apache2-mpm-prefork apache2-utils apache2-suexec libapache-asp-perl php5 php5-mysql libapache2-mod-php5 php-pear mysql-server mysql-client libmysqlclient15-dev
* During installation, the MySQL server will ask you for a password.Configure virtual hosts:
At the moment we should have a completely working Web server. We check by switching to the server's IP address through any browser from a computer on your local network. On the screen, if everything works correctly, the inscription "It, works!" Will appear.
Change the virtual hosts configuration file:
sudo nano /etc/apache2/sites-available/default
Erase the contents of the file and insert our new virtual host:
<VirtualHost .IP.:80> ServerAdmin somemail@some.ru ServerName .IP. ServerAlias .IP. DocumentRoot /server/site ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ </VirtualHost>
Now the folder where our site is / server / site.
All is ready! let's start installing Counter-Strike 1.6 server!Install and configure Counter-Strike 1.6 server
And so, first we need to download HldsUpdateTool from the site
www.steampowered.com (you can download to any tempo directory)
sudo wget http://www.steampowered.com/download/hldsupdatetool.bin
Next, set the rights and run hldsupdatetool.bin (At this stage, we will install Steam)
sudo chmod +x hldsupdatetool.bin sudo ./hldsupdatetool.bin
After a few minutes (or seconds, depending on your Internet connection), you can start installing the server part of Counter-Strike 1.6. We have a new
Steam file in the folder, with which we will work.
Download the server part:
./steam -command update -game valve -dir /server/cs
The dir parameter determines where the server will be installed. Next we download files for the Counter-Strike server.
./steam -command update -game cstrike -dir /server/cs
That's all, in principle (according to the theory of a spherical horse in a vacuum) the server is already ready. You can run and indulge. But it does not suit us. There is still the installation of mods and the statistics itself.
Moving on to installing and configuring the mods needed for a cozy game and player statistics.
Install metamod, amxmodx, dproto
For the statistics to work correctly (and in general), we need metamod, amxmodx, dproto mods.
From the beginning I downloaded the archives with mods, unpacked and uploaded to the server via FTP.
Download links:
MetaMod-1.19 LinuxAmxModX Base linuxAmxModX CS Addon LinuxDProto 0.9.179So, I hope everyone downloaded ... I spent 2 days searching for compatible versions =) The problem was that when searching google, the results were displayed with links to posts from 2007-2009 ... I took a shovel, picked sourceforge.net. Well, in general, you are all ready already =)
Go to the installation:
Create a folder in the cstrike subdirectory "addons / metamod / dlls /"
cd /server/cs/cstrike sudo mkdir addons cd addons sudo mkdir metamod cd metamod sudo mkdir dlls
Copy the metamod_i386.so
file to / server / cs / cstrike / addons / metamod / dlls /
Create a
plugins.ini file in the / server / cs / cstrike / addons / metamod folder
sudo nano /server/cs/cstrike/addons/metamod/plugins.ini
Edit the file / server / cs / cstrike /
liblist.gam sudo nano /server/cs/cstrike/liblist.gam ======================================================= gamedll_linux "addons/metamod/dlls/metamod_i386.so" // .
MetaMod installation is complete. We continue, on the approach of AmxModX.
Copy the amxmodx folder (you need to combine 2 archives downloaded earlier) in
/ server / cs / cstrike / addons .
Editing /server/cs/cstrike/addons/metamod/plugins.ini
sudo nano /server/cs/cstrike/addons/metamod/plugins.ini ======================================================== linux addons/amxmodx/dlls/amxmodx_mm_i386.so //
So, finished. More details on how to configure Amx can be read
here .
Installing dproto. This addon is necessary for us in order for players who use a non-licensed version of Counter-Strike to play without difficulty on our server.
Create a dproto folder in / server / cs / cstrike / addons /
cd /server/cs/cstrike/addons/ sudo mkdir dproto
Copy the file
dproto_i386.so from the archive that was downloaded earlier to the folder / server / cs / cstrike / addons / dproto
The
dproto.cfg configuration
file is copied to / server / cs / cstrike
Editing /server/cs/cstrike/addons/metamod/plugins.ini
sudo nano /server/cs/cstrike/addons/metamod/plugins.ini ======================================================== linux addons/amxmodx/dlls/amxmodx_mm_i386.so linux addons/dproto/dproto_i386.so //
Everything. Now let's check if the server is running, and whether our add-ons are installed.
We start the server:
./hlds_run -binary ./hlds_i686 -nomaster -game cstrike -port 27015 +ip .IP. -insecure
Started? If so, check with the
meta list command the list of running add-ons.
meta list Currently loaded plugins: description stat pend file vers src load unlod [ 1] dproto RUN - dproto_i386.so v0.4.8 ini Start Never [ 2] AMX Mod X RUN - amxmodx_mm_i386. v1.8.1.3 ini Start ANY 2 plugins, 2 running
If you got something like this (the STAT value should be RUN for our installed add-ons), then everything is fine. If nothing at all is displayed, then the problem lies at the very beginning, check the installation Metamod.
After the installation of mods is completed, proceed to the installation of statistics.
Installing Counter-Strike 1.6 Statistics (PsychoStats)
Here we have the first problems =) normal statistics on Counter-Strike 1.6, and most importantly modern, could not be found. but there is a previously popular project PsychoStats, with the latest version 3.2 (as far as I understood). The project site has long gone into oblivion ... I had to look for the psychostats_nightly.tar.gz file of more than 5.3 meters in size. Google helped and I found myself in the hands of an archive with a perl script and an upload folder containing files for uploading to the Web server. what you need
Pearl, pearl ... I learned that for the work of statistics pearl is needed and a couple more modules. Do not be tormented to look for how to find the missing modules via apt and so on. Install everything like this:
sudo apt-get install perl libconfig-inifiles-perl libdbd-mysql-perlsudo
Is done.
We will create a database for our statistics in advance. I did it through NaviCat.Upload the files from the upload folder to our Web-server. and proceed to install.
We launch the browser and follow this link -
https: //your website/install/index.phpInstallation should not cause you difficulties, since everything is described well enough. The only thing before the end is almost necessary to choose the type of game (
Half-Life => Counter-Strike ) and specify the folder with
log files (I have this / server / cs / cstrike / logs).
In 99% of cases, you will have a mountain of errors in the header of the site. Deprecated ... about how to get rid of them, I will tell later.
Copy the stats.pl script and everything else was there with it in the / server / cs / cstrike folder
And we proceed to the final stage ... Editing configs.
Editing configuration files
First we will have
stats.cfg sudo nano /server/cs/cstrike/stats.cfg ====================================================== dbtype = mysql // dbhost = localhost // dbport = 3306 // dbname = psychostats3_1 // dbuser = ps3 // dbpass = // dbtblprefix = ps_ // .. .
Now server.cfg ... You can customize as you like. But, there is one BUT. For the statistics to work, there should be the following lines:
sudo nano /server/cs/cstrike/server.cfg ========================================== log on sv_logbans 1 sv_logecho 1 sv_logfile 1 sv_log_onefile 0 mp_logdetail 3 mp_logmessages 1
Next in line is AmxModX. It is necessary to check whether the statistics collection modules are enabled:
sudo nano /server/cs/cstrike/addon/amxmodx/configs/plugins.ini ========================================================== // ; : admin.amxx statscfg.amxx statsx.amxx stats_logging.amxx
That's all.
Statistics is compiled by the stats.pl script. In order not to run it every time, I added it to cron. It will run every 10 minutes.
sudo crontab -e =================================================== */10 * * * * /server/cs/cstrike/stats.pl
Sigh ... check the server.
./hlds_run -binary ./hlds_i686 -nomaster -game cstrike -port 27015 +ip .IP. -insecure
It started - exhaled. Now the statistics will be displayed on your site =)
Malfunctions and solutions gadgets
The first thing that caught my eye was a huge number of errors on the site.
Half is treated by changing php.ini on your server.
We edit it, we find almost at the end the variable
mbstring.func_overload and expose it to the numeric value
7 . Just do not forget to take off; at the beginning of the variable.
The second half is errors in the code. The text of the error is indicated in which file and on which line the error.
Go to the file, find the line and remove the
& sign. Most often it occurs in this form
Some fignya =& new Some;
Pay attention to the version of addons that install. In this article, I gave links to compatible versions, but it's hard to find something suitable on the Internet.That's all =) according to the idea at the moment you are the owner of the working Counter-Strike server with player statistics and other things.
If you have any questions or problems, please contact me, I will help you as much as I can.
Thanks for attention.
UPD1:Thanks to blackp for a hint.
I quote:
“On x64 debian-based systems, you need to install lib32gcc1 and everything that the package pulls. Otherwise, you can get at the very beginning:
hldsupdatetool.bin no such file or directory »