Source-Engine Server Part1

Due to I still receive the HLDS maillinglist with a lot of update notification for the valve game servers in the last days, I decided to get back to my root off the “server administration thing” in a small simple game server project, based on my favourite source engine multiplayer game Day of Defeat: Source, but the main parts of the tutorial should also be useful for other source engine based games.

The result of this small tutorial series will be a Day of Defeat: Source Server, with Mani Admin Plugin as ingame administration tool and HLstatsX Community Edition as ranking system.

The server will be installed on a small vserver I got at Strato, based on Debian 5 Lenny, which currently only hosts the Teamspeak 3 server of my WoW guild with an small MySQL Server for the configuration storage. Well due to it’s not a powerful machine it will just host 10 to 12 slots in the end I think. But lets see what I can get out off that little box 🙂

The beginning

In the first step we will install our basic gameserver and join our first game 🙂

To start, we need the hlds update tool. It’s hidden on the steam homepage under tools, due to we are lazy admins, we download it directly to our server (mine is called minerva).

user@computer:$ wget

Due to it is not executable, we give it the executable flag and start it.

user@computer:$ chmod +x hldsupdatetool.bin && ./hldsupdatetool.bin

After you have accepted the licence with yes, the tool will extract the final steam client, which we will need to install the server.

When you run the tool the first time it will update it self to the latest version. This will probably take some time, due to the valve servers are often really slow. In the second run we let the tool show us the help output, so we see what parameters we need to install the game.

user@computer:$ ./steam
user@computer:$ ./steam
Checking bootstrapper version ...

Use: steam -command [parameters] [flags]


update: Install or update HLDS

-game - Game name: use 'list' to see available games
-dir - HLDS Install dir
(if dir not specified, will use value from last run of tool)

-verify_all - Verify all HLDS files are up to date
-retry - Automatically retry every 30 seconds if the Steam Network is busy
-remember_password - Remember password (if a username is supplied)

For example: steam -command update -game cstrike -dir /hlds

version: View installed versions

list: View available games

Optional parameters for all commands:

-username - Steam account username (only needed to access limited content)
- Steam account password (only needed to access limited content)

I want to install Day of Defeat: Source in the directory “/srv/dods/” (make sure you have created the target directory before you start the installation or the tool will hang at the beginning), so I need the following command (for the list of other available games use “-command list” as parameter)

user@computer:$ ./steam update -command update -game dods -dir /srv/dods

In the following process steam will download the dedicated server files you choose. This will take some time, so pick up a cup of coffee and wait 🙂

After that, the server is installed in a very basic setup. Cause it’s not nice when the game runs as root when we start it, we will create a user for that with his home directory set to “/srv/dods”, give him the rights on the server files and just switch to that user.

user@computer:$ useradd -d /srv/dods srcds && chown -R srcds:root /srv/dods && su srcds

Afterwards we switch to the folder in which the executable of the server is placed:

user@computer:$ cd /srv/dods/orangebox

The server executable takes a lot of parameters, you can find a list of them in the valve developer wiki. I have choosen the following for the fist start:

user@computer:$ ./srcds_run -game dod -autoupdate -maxplayers 10 -port 27015 +map dod_avalanche

With these parameters a server listening on port 27015 (Source-Engine games default), with the game Day of Defeat: Source, a maximum capacity of 10 players on the first map dod_avalanche will be started. The parameter “-autoupdate” allows the server to automatically download updates on startup.

Now open your Day of Defeat: Source client with the parameter “-console 1” and connect to your server 🙂

After that worked we stop the running server with “ctrl + c” switch back to root with the “exit” command and build us a small init script to start the server automatically if we have to reboot the whole server.
You can use the following which I found in the forums.

# Source Dedicated Server Init Script

# Server options
TITLE='Source Dedicated Server' # Script initialization title
LONGNAME='Day of Defeat Source'        # Full title of game type
NAME='dods'                          # Server handle for the screen session
DAEMON='srcds_run'                # The server daemon
STEAM='/srv/dods/orangebox'        # STEAM to Steam installation

# Game options
IP=''                # IP of the server
PORT='27015'                    # Port number to
MAP='dod_avalanche'                    # Initial map to start
GAME='dod'                        # Game type (tf|cstrike|valve|hl2mp)
SIZE='10'                        # Maximum number of players

# Server options string
OPTS="-game $GAME +hostname \"$CLIENT\" +map $MAP +ip $IP -port $PORT \
-autoupdate +maxplayers $SIZE -pidfile $STEAM/$GAME/$"

# Screen command
INTERFACE="sudo -u $USER /usr/bin/screen -A -m -d -S $NAME"

service_start() {
# Check if the pid files currently exist
if [ ! -f $STEAM/$GAME/$ ] && [ ! -f $STEAM/$GAME/$ ]; then
if [ -x $STEAM/$DAEMON ]; then
echo "Starting $TITLE - $LONGNAME"
echo "Server IP: $IP"
echo "Server port: $PORT"
echo "Server size: $SIZE players"
# Prevent race condition on SMP kernels
sleep 1
# Find and write current process id of the screen process
ps -ef | grep SCREEN | grep "$NAME" | grep -v grep | awk '{ print $2}' > $STEAM/$GAME/$
echo "$TITLE screen process ID written to $STEAM/$GAME/$"
echo "$TITLE server process ID written to $STEAM/$GAME/$"

echo "$TITLE started."
echo -e "Cannot start $TITLE.  Server is already running."
#exit 1
service_stop() {
if [ -f $STEAM/$GAME/$ ] && [ -f $STEAM/$GAME/$ ]; then
echo "Stopping $TITLE - $LONGNAME."
# Get the process ID from the pid file we created earlier
for id in `cat $STEAM/$GAME/$`
do kill -9 $id
echo "Killing process ID $id"
echo "Removing $TITLE screen pid file"
rm -rf $STEAM/$GAME/$
# Remove server pid file
echo "Removing $TITLE pid file"
rm -rf $STEAM/$GAME/$
# Wipe all old screen sessions
screen -wipe 1> /dev/null 2> /dev/null
echo "$TITLE stopped."
echo -e "Cannot stop $TITLE.  Server is not running."
#exit 1

case "$1" in
sleep 1
echo "Usage $0 start|stop|restart"

Place that script in “/etc/init.d/”, change the variables to your needs and update your servers init links. In debian for example with

user@computer:$ update-rc.d dods defaults

You can now start your server with the init-script

user@computer:$ /etc/init.d/dods start

That was the first part. We have now a small running server. In the next part we will configure the server and install the Mani Admin plugin.

2 Days down…. new hoster

As probably mentioned, my website was unreachable the last 2 Days. The reason for that was a filesystem crash of the server at where my vserver was hosted on. Cause of that outage, I decided to switch my email and websites to a new hoster.

Now my website is hosted on the high-available cluster of They provide a high available environment with everything you need for webhosting for just 5€ per month. Very nice offer, have a look. 🙂


Dokuwiki with Ldap against Novell eDirectory

Cause i found only one good post with google and for personal dokumentation 🙂 ,  here is how to configure Dokuwiki using Ldap with a Novell eDirectory.

Here are the lines in /conf/local.php you have to add  to enable ldap and to access the eDirectory.

$conf['useacl']      = 1;
$conf['openregister']= 0;
$conf['authtype']    = 'ldap';

$conf['auth']['ldap']['server']      = 'ldap://ldap.domain.tld:389';
$conf['auth']['ldap']['usertree']    = 'ou=users, o=someFirm';
$conf['auth']['ldap']['grouptree']   = 'ou=groups, o=someFirm';
$conf['auth']['ldap']['userfilter']  = '(&(uid=%{user})(objectClass=person))';
$conf['auth']['ldap']['groupfilter'] = '(&(objectClass=groupOfNames)(member=%{dn}))';

Note that you have to replace the “o=” , “ou=” and “server” values and that you have ldap support enabled in your php!