Установка cs 1.6 сервера на Linux

  • Создание сервера CS 1.6 и его настройки
  • Создание сервера сounter-strike 1.6 в Linux
  • Установка сервера counter strike 1.6 (Linux)
  • Установка сервера CS 1.6 на Linux

Установку будем производить на операционной системе CentOS 6.0. Перед установкой сервера counter-strike 1.6 имеем чистую систему, как раз после установки. Единственное, были выполнены команды:
yum update
yum install mc

Создадим папку где будем хранить весь исходный материал для серверов
[root@cs hdd2]# mkdir source

Скачаем hldsupdatetool.bin
[root@cs hdd2]# wget http://www.steampowered.com/download/hldsupdatetool.bin

Даём нужные права на файл:
[root@cs hdd2]# chmod +x hldsupdatetool.bin

Запускаем hldsupdatetool.bin
[root@cs hlds]# ./hldsupdatetool.bin
-bash: ./hldsupdatetool.bin: /lib/ld-linux.so.2: bad ELF interpreter: Нет такого файла или каталога
[root@cs hlds]#

У меня возникла ошибка. Решил её установкой:
[root@cs hlds]# yum install ld-linux.so.2
Пробуем снова
[root@cs hlds]# ./hldsupdatetool.bin

На вопрос отвечаем «YES»
Enter 'yes' to accept this agreement, 'no' to decline: yes

Выдало ошибку: «sh: uncompress: команда не найдена»
Enter 'yes' to accept this agreement, 'no' to decline: yes
sh: uncompress: команда не найдена
tar: Это не похоже на tar-архив
tar: Завершение работы с состоянием неисправности с из-за возникших ошибок
[root@cs hlds]# 

Решаем её следующим образом:
[root@cs hlds]#ln -s /usr/bin/gunzip /usr/bin/uncompress

Пробуем снова:
[root@cs hlds]# ./hldsupdatetool.bin

Если увидим ниже написанное, то все ок.
Enter 'yes' to accept this agreement, 'no' to decline: yes
extracting steam.tar.Z...done

Проверяем, появились ли нужные нам файлы:
[root@cs hlds]# ls
hldsupdatetool.bin  readme.txt  steam

Обновляемся, причем нас попросят это сделать два раза:
[root@cs hlds]# ./steam
Checking bootstrapper version ...
Getting version 45 of Steam HLDS Update Tool
Downloading. . . . . . . . . . . .
Steam Linux Client updated, please retry the command
[root@cs hlds]#
[root@cs hlds]# ./steam
Checking bootstrapper version ...
Getting version 45 of Steam HLDS Update Tool
Downloading. . . . . . . . . . . .
Steam Linux Client updated, please retry the command
CAsyncIOManager: 0 threads terminating.  0 reads, 0 writes, 0 deferrals.
CAsyncIOManager: 21 single object sleeps, 0 multi object sleeps
CAsyncIOManager: 0 single object alertable sleeps, 0 multi object alertable sleeps
[root@cs hlds]#

Создаем файл, через который будем в дальнейшем обновлять сервер:
[root@cs hlds]# touch update.sh

Даем нужные права на файл:
[root@cs hlds]# chmod +x update.sh

Записываем необходимое для обновления в файл:
[root@cs hlds]# echo ./steam -command update -game cstrike -dir . > update.sh

Проверяем:
[root@cs hlds]# cat update.sh
./steam -command update -game cstrike -dir .
[root@cs hlds]#

Скачиваем (обновляем) сервер:
[root@cs hlds]# ./update.sh
Checking bootstrapper version ...
Updating Installation
No installation record found at .
No installation record found at .
No installation record found at .
Checking/Installing 'Counter-Strike Base Content' version 35

0.16%   downloading ./cstrike/cl_dlls/client.dll
0.16%   downloading ./cstrike/classes/ak47.res
0.16%   downloading ./cstrike/classes/arctic.res
0.16%   downloading ./cstrike/classes/aug.res
0.16%   downloading ./cstrike/classes/autoselect_ct.res
0.16%   downloading ./cstrike/classes/autoselect_t.res
0.16%   downloading ./cstrike/classes/awp.res
0.16%   downloading ./cstrike/classes/cancelbutton.res
0.16%   downloading ./cstrike/classes/default.res
0.16%   downloading ./cstrike/classes/defuser.res
0.16%   downloading ./cstrike/classes/deserteagle.res
0.16%   downloading ./cstrike/classes/elites.res
0.16%   downloading ./cstrike/classes/equipment.res

Ждем пока скачается
99.06%  downloading ./valve/valve.rc
99.06%  downloading ./valve/valvecomm.lst
100.00% downloading ./valve/xeno.wad

Connection Reset, errno 104 "Connection reset by peer"
CAsyncIOManager: 0 threads terminating.  0 reads, 0 writes, 0 deferrals.
CAsyncIOManager: 76 single object sleeps, 0 multi object sleeps
CAsyncIOManager: 0 single object alertable sleeps, 0 multi object alertable sleeps
[root@cs hlds]#

Создадим скрипт для запуска-проверки сервера:
[root@cs hlds]# chmod +x start.sh
[root@cs hlds]# vi start.sh

Содержимое файла «start.sh»
#!/bin/bash
echo «Starting CS:1.6»
sleep 1
./hlds_run -binary ./hlds_i686 -game cstrike -secure -console -pingboost 1 +exec server.cfg -verify_all +port 27015 +maxplayers 22 +map de_dust2 +ip 0.0.0.0

Запускаем
[root@cs hlds]# ./start.sh
Starting CS:1.6
Auto-restarting the server on crash

Console initialized.
scandir failed:/hdd2/source/hlds/./valve/SAVE
scandir failed:/hdd2/source/hlds/./platform/SAVE
Protocol version 48
Exe version 1.1.2.6/Stdio (cstrike)
Exe build: 16:56:12 Mar  8 2010 (4883)
STEAM Auth Server
couldn't exec listip.cfg
couldn't exec banned.cfg
Server IP address 0.0.0.0:27015
scandir failed:/hdd2/source/hlds/./valve/SAVE
scandir failed:/hdd2/source/hlds/./platform/SAVE
[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

scandir failed:/hdd2/source/hlds/./valve/SAVE
scandir failed:/hdd2/source/hlds/./platform/SAVE
[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

couldn't exec listip.cfg
couldn't exec banned.cfg
scandir failed:/hdd2/source/hlds/./valve/SAVE
scandir failed:/hdd2/source/hlds/./platform/SAVE
[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

Connection to Steam servers successful.
   VAC secure mode is activated.
Птн Сен  2 07:22:45 NOVST 2011: Server Quit

[root@cs hlds]#

Исправляем ошибки:
couldn't exec listip.cfg

Создаем файл в listip.cfg папке cstrike:
[root@cs hlds]# touch cstrike/listip.cfg

Ошибка
couldn't exec banned.cfg

Создаем файл в banned.cfg папке cstrike:
[root@cs hlds]# touch cstrike/banned.cfg

Ошибка
scandir failed:/hdd2/source/hlds/./valve/SAVE

Создаем папки valve/SAVE в корне сервера
[root@cs hlds]# mkdir valve/SAVE

Ошибка
scandir failed:/hdd2/source/hlds/./platform/SAVE

Создаем папки platform/SAVE в корне сервера
[root@cs hlds]# mkdir platform
[root@cs hlds]# mkdir platform/SAVE

Пробуем запустить снова:
[root@cs hlds]# ./start.sh
Starting CS:1.6
Enabling debug mode
./hlds_run: line 134: gdb: команда не найдена
Please install gdb first.

Исправляем ошибку:
[root@cs hlds]# yum install gdb

Проверяем:
[root@cs hlds]$ ./start.sh
Starting CS:1.6
Enabling debug mode
Auto-restarting the server on crash

Console initialized.
Protocol version 48
Exe version 1.1.2.6/Stdio (cstrike)
Exe build: 16:56:12 Mar  8 2010 (4883)
STEAM Auth Server
Server IP address 0.0.0.0:27015
[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

[S_API FAIL] SteamAPI_Init() failed; unable to update local steamclient. Continuing with current version anyway.

Connection to Steam servers successful.
   VAC secure mode is activated.

Пользователь для сервера
Создадим пользователя от которого будем управлять и запускать сервер:
[root@cs hlds]# useradd gsrv

Установим пароль для пользователя «gsrv»:
[root@cs hlds]# passwd gsrv
Смена пароля для пользователя gsrv.
Новый пароль :
Повторите ввод нового пароля :
passwd: все токены проверки подлинности успешно обновлены.
[root@cs hlds]# 

Передаем права пользователю gsrv
[root@cs hlds]# chown -R gsrv:gsrv source/

Дальше все действия будем выполнять от пользователя gsrv
[root@cs hdd2]# su gsrv
[gsrv@cs hdd2]$


Настройка IPTABLES
Создадим файл
[root@cs rc.d]# vi /etc/rc.d/rc.fw

со следующим содержимым:
#! /bin/sh
WAN_IF="eth0"
WAN_IP="ИП_АДРЕС_ВАШЕГО_СЕРВЕРА"

LO_IF="lo"
LO_IP="127.0.0.1"
LO_MASK="255.0.0.0"
LO_NET="$LO_IP/$LO_MASK"

SERV_PORT="27015:27025"
SHH_PORT="22"

IPT="/sbin/iptables"
$IPT -F
$IPT -t nat -F
$IPT -t mangle -F
$IPT -X
$IPT -P INPUT DROP
$IPT -P OUTPUT ACCEPT
$IPT -A INPUT -i $LO_IF -j ACCEPT
$IPT -A OUTPUT -o $LO_IF -j ACCEPT
$IPT -A INPUT -p ICMP --icmp-type 8 -j ACCEPT
$IPT -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
$IPT -A INPUT -p TCP --dport 22 -j ACCEPT
$IPT -A INPUT -p tcp --dport 27015 -j ACCEPT
$IPT -A INPUT -p udp --dport 27015 -j ACCEPT

[root@cs rc.d]# chmod +x rc.fw

[root@cs init.d]# yum install screen
comments powered by Disqus

0 комментариев

Оставить комментарий