Talon’s (Micah) Blog

God, Christian Gamers, Computers, Games

Skip to: Content | Sidebar | Footer

Linux HLDS/SRCDS Installation

First you want linux machine with internet obviously. Steam based servers will run on dabien and repository based Distros.

First create a user for your server, shell acount. Login to webmin on your linux box and creat a /bin/bash shell acount. Default home directory is /home/*user*/

Login to your server via SSH (putty) and make the directory with:

- mkdir hlds (or) srcds (or what you want to call it)

- cd /folder

Next you want to download the hldsupdatetool.

- wget http://www.steampowered.com/download/hldsupdatetool.bin

Next is to reset the permissions and exec it:

- chmod +x hldsupdatetool.bin

- ./hldsupdatetool.bin

Follow the instructions and hit yes or accept or whatever.

This will extract a “steam” binary file, exec it
- ./steam

That will grab the latest steam binary build, it should say please run steam client again after it updated.

Next is your install command for a cs1.6 installation:

- ./steam -command update -game cstrike -dir /home/*user*

for a CSS installation:

- ./steam -command update -game “counter-strike source” -dir /home/*user*

for a dod:s installation

- ./steam -command update -game dods -dir /home/*user*

for a hl2 deathmatch or mod installation:

- ./steam -command update -game hl2mp -dir /home/*user*

For other game installations run the:
- ./steam -command update -game list

command and it will list all servers you can install.

This will take a while to download depending on what you are doing.

Next you want to create a start/restart/stop scripts:

echo “Starting Server”
echo “cd ..”
echo “cd ..”
echo “cd /home/*user*/”
echo “sh start.sh”
screen -A -m -d -S servername /home/*user*/srcds_run -console -cstrike +map de_dust2 +maxplayers 26 -autoupdate -IP xxx.xxx.xxx.xxx -port 27015 +fps_max 200 -tickrate 66 -pingboost 3
echo “Server Starting…”
echo “Parameters srcds_run -console -cstrike +map de_dust2 +maxplayers 26 -autoupdate -IP xxx.xxx.xxx.xxx -port 27015 +fps_max 200 -tickrate 66 -pingboost 3″
echo “…Server Started”

Copy this block and paste it into notepad, edit it for your start parameters, ip, server settings, slots and the location of the server. Save the notepad as “start.sh”, take off the .txt Upload it to your server directory via WINSCP through SSH.

Next is your Stop script:

echo “Stopping Server…”
screen -dr servername -X quit
echo ” ”
echo “…Server Stopped”

Do the same as the start script only name it “stop.sh”. This will terminate the screen effectivly shutting down the server.

Next is your restart script:

echo “Restarting Server…”
echo “screen -dr servername -X quit”
screen -dr servername -X quit
echo “Server Stop successful…”
echo “cd ..”
echo “cd ..”
echo “cd ..”
echo “cd /home/*user*/”
cd ..
cd ..
cd ..
cd ./home/*user*/
sh server.sh
echo “sh server.sh”
echo “…Server Restart Successful”

If you want to start the server, simply login through SSH and goto the server install directory, and do “sh server.sh”, if you want to stop the server “sh stop.sh” if you want to restart the server process with 1 command then do “sh restart.sh”. You can customize these scripts how you want, the “echo” prints the stuff inside the quotes to the putty window when you exec the sh script. They are not needed but are there for information purposes.

For HLDS users, the argument is a bit different:

screen -A -m -d -S servername /home/*user*/hlds_run -console -cstrike +map de_dust2 +maxplayers 26 -autoupdate -IP xxx.xxx.xxx.xxx -port 27015 -sys_ticrate 200 -pingboost 3

The sys_ticrate is what the server FPS is, there is no such thing in HLDS as tickrate such as there is in SRCDS.

For HLDS admin mod installation:

download admin mod v 2.50.60. Unzip it and upload to server via WINSCP

- cd ./ inside the adminmod folder

- ./install the script (I think its install-admin or install_admin)

follow the instructions and it will install to HLDS. Then simply download the latest metamod binary and upload it to the server (admin mod has a way outdated version).

For SRCDS, download Mani admin plugin

Upload the contents to the server install directory and thats it.

I’m not going to go through configing any plugins, its pretty self explanatory how to config them once they are installed.

Now to setup auto start on system boot. Login to webmin and go to “system” and then to “bootup and shutdown”, then scroll down to bottom and you will find the last entry in the table “/etc/rc.d/rc.local”. Click that link and put this code inside it, below the stuff inside it already:

sudo -u shellaccountusername sh -c “cd /home/*user*/; sh start.sh”

Or if you dont have webmin or a control panel thing installed, you can go into /etc/rc.d/ and edit the rc.local and put it in there, that controls custom user services that want to be started up.

Next is setting up routine server reboot scripts:

- In webmin go to “system”, “scheduled cron jobs”, then create a new cron job.

- the “execute cron job as” box, put in the shell account username:

- in the “command” box, put “sh restart.sh”

- then select your times to reboot server, you can do every day, every other day, its really flexible.

Next is setting up server log rotations:

- cd /home/*user/cstrike/logs

- mkdir old

- login to webmin, go to “system” then to “log rotations”, create a new log rotation. Setting it up for what you want.

Last updated 05sept06

Write a comment

You need to login to post comments!