[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:software:halflife_dedicated_server [2013/03/09 16:09 (UTC)] – created alienbob | howtos:software:halflife_dedicated_server [2019/02/21 11:35 (UTC)] (current) – removed markand | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Installing a Half-Life Dedicated Server ====== | ||
- | This article will guide you through the installation and configuration of a Half-Life Dedicated Server (HLDS). Half-life was [[http:// | ||
- | Running a Half-Life server is fun for you and your friends. The Half-Life game is resource-friendly and fast -even on not-too-new hardware. Running a Half-Life server allows you to choose the list of maps which will be rotated on your server or other forms of customization (like password-protecting the server so that //you// determine who can join the games). | ||
- | |||
- | The Half-Life Dedicated Server has been available for Linux ever since the game was released. However the //game// itself has only recently been ported to Linux. It has become available as the first commercial game for the native Linux port of the Steam client in early 2013. Together with the free-to-play Team Fortress 2 you have two very good reasons to start playing games in the Steam content platform. | ||
- | |||
- | Installing the Half-Life server and keeping it updated, requires that you use the Steam updater. | ||
- | |||
- | < | ||
- | |||
- | ==== Deciding on a Server host ==== | ||
- | |||
- | The Steam program as well as the game servers that run under Steam, are 32-bit programs. It makes most sense to run the server on a 32-bit Slackware host. | ||
- | |||
- | If your server is 64-bit Slackware, and you do not want to install multilib, then you have two options: | ||
- | - setup a 32-bit Slackware in a LXC container. Slackware supports LXC (an [[wpen> | ||
- | - setup a 32-bit Slackware in a Virtual Machine (using QEMU or VirtualBox for instance). | ||
- | |||
- | The virtual 32-bit Slackware machine does not have to be a full installation. You can set up a minimal Slackware that uses less than 500 MB of diskspace. See [[howtos: | ||
- | |||
- | ==== Preparing your Server ==== | ||
- | |||
- | As the "// | ||
- | # groupadd steam | ||
- | # useradd -g steam -m -d /home/steam -c "Steam server account" | ||
- | </ | ||
- | # passwd steam | ||
- | </ | ||
- | |||
- | < | ||
- | |||
- | In the example below, I will use the directory "'' | ||
- | |||
- | You will now continue as the user "// | ||
- | # su - steam | ||
- | </ | ||
- | * Create a logging directory, we will be using that later: < | ||
- | $ mkdir ~/ | ||
- | </ | ||
- | * Download and extract the archive containing "'' | ||
- | $ mkdir downloads | ||
- | $ cd downloads | ||
- | $ wget http:// | ||
- | </ | ||
- | $ mkdir -p ~/ | ||
- | $ tar -C ~/ | ||
- | </ | ||
- | * Launch SteamCMD for the first time: < | ||
- | $ cd ~/ | ||
- | $ ./ | ||
- | </ | ||
- | * To download the Half-Life game server files, you login to your Steam server account: </ | ||
- | Steam> login < | ||
- | </ | ||
- | * Enter your password. Then check your e-mail for your Steam Guard access code and enter it (you will only need to do this once per computer). \\ You should see a message stating that you have successfully logged in with your account. | ||
- | * Set your server install directory. In this article, we will use a subdirectory "// | ||
- | Steam> force_install_dir ./hlds_l/ | ||
- | </ | ||
- | * Install or update the HLDS game server files. Every Steam application has its own "// | ||
- | Steam> app_update < | ||
- | </ | ||
- | Steam> app_update 90 validate | ||
- | </ | ||
- | * Once the download and update is finished, type " | ||
- | Steam> quit | ||
- | </ | ||
- | |||
- | This will have populated the " | ||
- | |||
- | |||
- | ==== Starting the Game Server ==== | ||
- | |||
- | The // | ||
- | |||
- | You can start the Half-Life game server directly using the following commands: < | ||
- | $ cd ~/ | ||
- | $ ./hlds_run -game valve +maxplayers 4 +map CObase +exec server.cfg | ||
- | </ | ||
- | If your server is multi-homed (i.e. it has multiple IP addresses) or you want to run the server on a non-standard port, then you may be required to add commandlin parameters like "'' | ||
- | |||
- | Because this is a game server, you do not want to be forced to keep a terminal opened all the time while the server is running. Therefore it is much more convenient to run the server in a "'' | ||
- | $ cat <<EOT > / | ||
- | #!/bin/bash | ||
- | cd server/ | ||
- | screen -A -mdLS hlds_valve -c / | ||
- | EOT | ||
- | $ chmod +x / | ||
- | $ cat << EOT > / | ||
- | log on | ||
- | logfile / | ||
- | EOT | ||
- | </ | ||
- | Now you can run this start script and it will start the Half-Life Dedicated server in a '' | ||
- | # Start the Half-Life Dedicated Server: | ||
- | if [ -x / | ||
- | echo " | ||
- | su - steam -c " | ||
- | fi | ||
- | </ | ||
- | |||
- | ==== Automatically update the game server files ==== | ||
- | |||
- | It is good practice to let the Steam components update themselves. You can use a cron job to run an update once a day. | ||
- | |||
- | Create a wrapper script which updates the game(s) automatically. \\ Save the following lines to a new file "'' | ||
- | $ cat <<EOT > ~/ | ||
- | #!/bin/sh | ||
- | / | ||
- | EOT | ||
- | $ chmod 755 ~/ | ||
- | </ | ||
- | // Update hlds (valve directory, app_id 90) | ||
- | login my_user my_pass | ||
- | force_install_dir / | ||
- | app_update 90 validate | ||
- | exit | ||
- | </ | ||
- | 55 3 * * * / | ||
- | </ | ||
- | |||
- | |||
- | ====== Sources ====== | ||
- | * Originally written by [[wiki: | ||
- | <!-- * Contributions by [[wiki: | ||
- | |||
- | <!-- Please do not modify anything below, except adding new tags.--> | ||
- | {{tag> |