Knowledgebase
Setup a Counter-Strike Server
| SSH to your server. Below I'm assuming you have logged into a user other than root. su to root (If you initially logged into root when you ssh'ed to the server, this command can be disregarded). su - I recommend that you run HLDS on a specific user. While you can run it under whatever user you like, even root, it makes it easier to manage and keep organized running it as its own user: useradd hlds passwd hlds exit (Only if you su'ed to root, and didn't initially log in as root) Now download the files either using wget from your server or downloading them yourself and uploading them to the hlds user. http://www.3dgamers.com/dl/games/ha...1_full.bin.html http://www.counter-strike.net/linux_full.html Once the servers are in your /home/hlds directory (and you are there too) do the following: chmod +x hlds_l_3111_full.bin ./hlds_l_3111_full.bin Answer 'Yes' at the prompt. tar -xvzf hlds_l_3111_full.tar.gz This should have created a directory named "hlds_l" containing all the HLDS files. I personally hate the _l part of the directory name and like to do the following: mv hlds_l hlds That should have renamed the directory to just "hlds". Now put the CS server file you downloaded in the "hlds" directory: mv cs*.tar.gz hlds Go into the HLDS directory: cd hlds Untar the file: tar -xvzf cs*.tar.gz This should have created a directory named "cstrike". Go into the "cstrike" directory: cd cstrike Edit the server.cfg file and if you like, the optional motd.txt and mapcycle.txt files: You can find CS server commands at http://server.counter-strike.net You also probably want to add an rcon password for the server. To do so, do the following: pico -w server.cfg Put the rcon password on its own line, anywhere in the file: rcon_password yourpassword [ctrl + x] [y] [enter] Next we go back to the "hlds" directory and make a script to start he server: cd .. pico -w startcs ./hlds_run -game cstrike +maxplayers 16 +map de_dust& ------------------------------------------------------------------------------------ The above line can be customized to fit your needs, as well you can add extra options. Also, the & makes the server launch into the background. Without it, as soon as you exit the ssh session, your CS server will die. HLDS has a ping booster built in. Just add... -pingboost # ...to your start line. For example: ./hlds_run -game cstrike -pingboost 1 +maxplayers 16 +map de_dust& The number (1 in the example) tells how much you want to boost pings. 1 Gives a small boost without using very much extra CPU. 2 Gives a pretty good boost but uses a bit more CPU. 3 Is a CPU hog and not recommended unless you think your CPU can handle it. ----------------------------------------------------------------------------------- [ctrl + x] [y] [enter] chmod +x startcs Now the script is created, all you have to do is run it to start your CS server. ./startcs Thats it. Your CS server should be running now. |