I myself run a couple of servers on Debian
and Redhat Linux machines. Personally I prefer the Debian distribution
above
the Redhat distribution due to the stability
of it.
But nevertheless the Redhat machine also works perfect for me.
I assume you already downloaded all the necessary files I mentioned in the server part of this site, so I'll start right away.
The following instructions are the same
as I installed my Counter-Strike servers. You can choose your own path/install
dir. They
do NOT have to be the same as the
ones listed below.
When you telnet or SHH to your Linux machine,
your prompt ( all commands should take place from the prompt ) probably
will
look something like this:
login@server:/var/home/login$
From this prompt on we will do the following :
cd /usr/local/games <enter>
mkdir halflife <enter>
cd halflife <enter>
chmod +x hlds_l_3110_full.bin<enter>
./hlds_l_3110_full.bin <enter>
Bla bla bla yada yada yada ...
agreement, either oral or written, and any other communications
between
Valve and you regarding the subject matter hereof.
Enter 'yes' to accept this agreement, 'no' to decline: yes<enter>
extracting hlds_l_3110_full.tar.gz...done
When you have accepted the Valve agreement,
the hlds_l_3110_full.bin file will change
to hlds_l_3110_full.tar.gz
We'll continue doing the following :
tar zxvf hlds_l_3110_full.tar.gz<enter>
cd hlds_l <enter>
When the file is extracted completely,
you have a fully functional Linux Half-Life dedicated server installation
ready.
We'll move on to the Counter-Strike installation
next.
Copy or download the Counter-Strike Full Linux Server file to the hlds_l directory ( where the HL server is installed after the extraction ).
tar zxvf cs_15_full.tar.gz <enter>
And voila ! You've now installed the latest
Half-Life dedicated server, and installed the latest Counter-Strike release.
You can finetune
your motd.txt ( welcome text when
entering the server ) and your server.cfg in your /hlds_l/cstrike/
directory, using
vi or pico.
The easiest way to keep your server up
and running, is to use screen. Screen is an application that is
part of the default distribution
of many types of Linux. It allows you
to create virtual terminal screens which can be detached and run in the
background, then re-attached
and brought to the foreground at will.
In MS-Windows terms, think of it like minimizing a window. It's still there
and running, you just aren't
looking at it on your desktop.
Now let's get started ...
cd /usr/local/games/halflife/hlds_l <enter>
screen <enter>
export LD_LIBRARY_PATH=/halflife/hlds_l:$LD_LIBRARY_PATH <enter>
What the above does is tells Linux to look
in the "/halflife/hlds_l" directory for dynamic libraries, don't
forget to change the paths to your
own system. As you can see I use /halflife/hlds_l
but maybe you have used a different path, like /games/hlds_l
If you don't use the right path, the server will NOT work, so please doublecheck before you start.
We'll continue starting the server doing the following :
./hlds_run -game cstrike +exec server.cfg +ip 168.192.10.11 +port 27015 +maxplayers 16 +map de_dust <enter>
( 168.192.10.11 is a fake IP ... you will have to fill in the IP adress you are gonna use on the machine to run your server !!! )
The server will start up and you will see the following :
Auto-restarting the server on crash
Host_Init
Added packfile /usr/local/games/hlds_l/valve/pak0.pak
(985 files)
Protocol version 46
Exe version 3.1.1.0
Exe build: 14:46:34 Jun 11 2002
(2056)
WON Auth Server
Server IP address 168.192.10.11:27015
Downloading Security Module from
Speakeasy.net ...
Completed downloading Security Module
from Speakeasy.net
Server is in Secure Mode.
At this point you have a fully functional
Counter-Strike server running for 16 players and starting up with de_dust
as map. In your server.cfg
you can give the mp_timelimit how
long you want each map to run on the server before it changes to another.
All maps running on the server
can be viewed in the mapcycle.txt
in the /hlds_l/cstrike/ directory.
Now you can do the following command to execute screen and force the process to be send to the background.
CTRL A+D <detached>
Okay, what you've done now with the CTRL A+D command, is to "detach" the current operation, and if you want to, you can even log out of the server and keep the Counter-Strike server running. You can also go back to the process by typing screen -r <enter> on your shell prompt.
And detach again
CTRL A+D
and back to it
screen -r
detach ...
CTRL A+D
etc. etc.
Now we are gonna go one step further, and try to run multiple servers on one machine.
Telnet or SHH to your server and do the following:
cd /usr/local/games/halflife/hlds_l <enter>
screen <enter>
export LD_LIBRARY_PATH=/halflife/hlds_l:$LD_LIBRARY_PATH <enter>
./hlds_run -game cstrike +exec server.cfg +ip 168.192.10.11 +port 27015 +maxplayers 16 +map de_dust <enter>
CTRL A+D <detached>
cd /usr/local/games/halflife/hlds_l<enter>
screen <enter>
export LD_LIBRARY_PATH=/halflife/hlds_l:$LD_LIBRARY_PATH <enter>
./hlds_run -game cstrike +exec server.cfg +ip 168.192.10.11 +port 27025 +maxplayers 16 +map de_dust <enter>
CTRL A+D <detached>
cd /usr/local/games/halflife/hlds_l <enter>
screen <enter>
export LD_LIBRARY_PATH=/halflife/hlds_l:$LD_LIBRARY_PATH <enter>
./hlds_run -game cstrike +exec server.cfg +ip 168.192.10.11 +port 27035 +maxplayers 16 +map de_dust <enter>
CTRL A+D <detached>
At this moment you have 3 Counter-Strike
servers running on the server, each on a different port. 27015, 27025 and
27035. Now
someone should be able to connect to your
servers and play on it with the following adresses:
168.192.10.11:27015
168.192.10.11:27025
168.192.10.11:27035
You can go back to your screen session
at any time on your server still using the screen -r command. At
that time you will get
some information on your screen, which
looks like this:
login@server:/var/home/login$screen
-r
There are several suitable screens
on:
102.pts-9.server (Detached)
103.pts-9.server (Detached)
104.pts-9.server (Detached)
Type "screen [-d] -r [pid.]tty.host"
to resume one of them.
login@server:/var/home/login$
Now if you do screen -r 102 you
would return to the 27015 session. If you do screen -r 103 you'll
return
to the 27025 session,
and screen -r 104 for the 27035
session.
If we go one step further with multiple
servers on one machine, it is also possible to let each server start up
with a different
server.cfg, motd.txt and
mapcycle.txt
You just add the following cvar's to your startup line.
+servercfgfile
+mapcyclefile
+motdfile
When you want to use 3 different mapcycle.txt's, server.cfg's and motd.txt's you're startup line would look like this:
./hlds_run -game cstrike +ip 168.192.10.11
+port 27015 +servercfgfile server.27015 +mapcyclefile mapcycle.27015
+motdfile motd.27015 +maxplayers 16
+map de_dust
./hlds_run -game cstrike +ip 168.192.10.11
+port 27025 +servercfgfile server.27025 +mapcyclefile mapcycle.27025
+motdfile motd.27025 +maxplayers 16
+map de_dust
./hlds_run -game cstrike +ip 168.192.10.11
+port 27035 +servercfgfile server.27035 +mapcyclefile mapcycle.27035
+motdfile motd.27035 +maxplayers 16
+map de_dust
And offcourse you can run these lines under screen as well.
The above settings about running multiple servers are only tested by me on Counter-Strike servers. I haven't tested it on Day of Defeat or Frontline Force servers, so therefor I cannot guarantee that it will work on those mod's, and they will also NOT work on former Beta version of Counter-Strike like Beta 5.2 and Beta 6.1
What I do know is that the above written startup lines and cvar's work good. If you have any problem with setting up such a server you can contact me using the forum.