You will need access as root or super user to a GNU/Linux Machine, or have the system admin install screen and wget for you.
In this tutorial, I’m using a Red-Hat based distribution, named CentOS, version 6.3 – 64 bit
These are the steps needed to install a Counter-Strike 1.6 Server:
Install screen and wget
[root@howto ~]# yum -y install screen wget
Create a symlink for uncompress (this is needed by hldsupdatetool.bin)
[root@howto ~]# ln -s /usr/bin/gunzip /usr/bin/uncompress
Make the server start on system boot
[root@howto ~]# echo "su - hlds -c "/home/hlds/start_hlds"" >> /etc/rc.local
Add user “hlds” and set a password for it
[root@howto ~]# useradd hlds [root@howto ~]# passwd hlds
Switch to hlds user and check current directory afterwards
[root@howto ~]#su - hlds [hlds@howto ~]$ pwd /home/hlds
Download hldsupdatetool.bin from steampowered.com
[hlds@howto ~]$ wget http://www.steampowered.com/download/hldsupdatetool.bin
Make the file executable and run it
This will extract the steam tools needed to download and install the server
[hlds@howto ~]$ chmod +x hldsupdatetool.bin [hlds@howto ~]$ ./hldsupdatetool.bin Enter 'yes' to accept this agreement, 'no' to decline: Enter 'yes' to accept this agreement, 'no' to decline: yes extracting steam.tar.Z...done
You may list the files and see the newly extracted files
[hlds@howto ~]$ ls -l total 11076 -rwxrwxr-x 1 hlds hlds 3513408 Sep 2 2005 hldsupdatetool.bin -rw-r--r-- 1 hlds hlds   3413 Apr 7 2005 readme.txt -rwxr-xr-x 1 hlds hlds 7822833 Apr 7 2005 steam
Update Valve
[hlds@howto ~]$ ./steam -command update -game valve -dir . 0:01Â Â Â Â Fetching exclude list 0:01Â Â Â Â Calculating download size 0:02Â Â Â Â No files will be downloaded 0:02 [80.239.194.134:27030] Disconnecting HLDS installation up to date
Update Counter Strike
The command needs to be ran 3 times, each time it performs a different operation, just follow the instructions on screen
[hlds@howto ~]$ ./steam -command update -game cstrike -dir . Checking bootstrapper version ... Getting version 45 of Steam HLDS Update Tool Downloading. . . . . . . . . . . . Steam Linux Client updated, please retry the command
[hlds@howto ~]$ ./steam -command update -game cstrike -dir . 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
[hlds@howto ~]$ ./steam -command update -game cstrike -dir . ... 99.06% downloading ./valve/valve.rc 99.06% downloading ./valve/valvecomm.lst 100.00% downloading ./valve/xeno.wad HLDS installation up to date CAsyncIOManager: 0 threads terminating. 0 reads, 0 writes, 0 deferrals. CAsyncIOManager: 74 single object sleeps, 0 multi object sleeps CAsyncIOManager: 0 single object alertable sleeps, 0 multi object alertable sleeps
Create the startup script and make it executable
Make sure you edit the ip, port, cpu, number of players, sys_ticrate, etc acording to your needs
[hlds@howto ~]$ echo '#!/bin/bash' > /home/hlds/start_hlds [hlds@howto ~]$ echo "screen -A -mdLS hlds_cstrike -c /home/hlds/.screenrc ./hlds_run -binary ./hlds_i686 -console -debug -game cstrike -port 27015 -pingboost 2 +sys_ticrate 1000 +heapsize 1048576 +sv_maxupdaterate 100 +secure +sport 27014 +ip <code>85.25.243.169</code> +maxplayers 32 +map cs_assault -pidfile hlds.pid +cpu 8 -autoupdate" >> /home/hlds/start_hlds [hlds@howto ~]$ chmod +x /home/hlds/start_hlds
Make the last adjustments before starting the server
[hlds@howto ~]$ echo "logfile /home/hlds/hlds_screen.log" > /home/hlds/.screenrc [hlds@howto ~]$ touch /home/hlds/cstrike/listip.cfg [hlds@howto ~]$ touch /home/hlds/cstrike/banned.cfg [hlds@howto ~]$ mkdir -p /home/hlds/SAVE [hlds@howto ~]$ mkdir -p /home/hlds/valve/SAVE [hlds@howto ~]$ mkdir -p /home/hlds/platform/SAVE
Start the server and check if it is running
[hlds@howto ~]$ ./start_hlds [hlds@howto ~]$ netstat -tuanlp |grep hlds (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) udp       0     0 85.25.243.169:26900        0.0.0.0:*                              4079/./hlds_i686 udp       0     0 85.25.243.169:27015        0.0.0.0:*                              4079/./hlds_i686
If you want to gain access to console, enter the screen session by issueing
[hlds@howto ~]$ screen -x hlds_cstrike
Exit the screen by pressing CTRL + a + d
If you just want to check the logs in real time use
[hlds@puck233 ~]$ tail -f hlds_screen.log
Exit by pressing CTRL + c
Hi, I have a CentOS 6.3 with minimal desktop installation.
I do some steps, but, when I run this command:
[hlds@howto ~]$ ./hldsupdatetool.bin
I have this error:
-bash: ./hldsupdatetool.bin: /lib/ld-linux.so.2: bad ELF interpreter: File or directory not found.
What can I do now? :/
Please, help me!
Hi,
There is an older post about this issue, here is the way to solve it:
http://www.howtodoityourself.org/2012/05/04/how-to-fix-libld-linux-so-2-bad-elf-interpreter-no-such-file-or-directory.html
All you need to do is install glibc, on CentOS is done as follows:
yum -y install glibc.i686
If you encounter any other issues comment out and if I’m able to help I’ll reply.
Hey, thx for this good wiki.
How can i restart the cs server ? or stop it ?
its possible to do a auto restart each day ?
thx a lot 🙂
Hi, you may use a cron job to run daily and do what you want (just google for adding cron jobs). The easy way is to run the kill command on the process ID and then run again the start command or you could create an init script.
hi, this tutorial is old an not work 100% , new to make a cs server you need to use steamcmd, kane you remake this tutorial with steamcmd pls?
ty.
Unfortunately my time is quite limited lately, I will do my best and update this, most likely I will also include CS:GO.