Weapons Factory Arena: Linux Server Setup Guide
Ok, to start you need to have Q3A installed on you server and updated to v1.17. And you will need to download the proper WFA server files from the WFA website.
Step 1: Begin by getting the necessary server files from the WFA website and uploading them to your server, extract them to the proper directories. I.E. "/usr/local/games/quake3" Using the command line "gunzip WFA_BETA_1.0_UNIX.gz" inside your WFA directory, then "tar xvf WFA_BETA_1.0_UNIX.tar" and you will have extracted all the server files to your WFA directory. Now you are ready to start making configs and shell scripts (it sounds harder than it really is, dont worry :) Also make a directory named "logs" under your quake3 directory, more on this later.
Step 2: Making a wfa-server.cfg
Start by creating a new document with PICO or your favorite text editor (i.e. VI) the command line should be "pico wfa-server.cfg". This will create a new document called "wfa-server.cfg" Below is an example of what it should look like, along with detailed explanations of each variable you need to set. remember anything after a "//" denotes a comment, and will be ignored when the config is executed. If you dont want to write the config, you can download the one at the bottom of the page and edit that for your config file.
// WFA Server Config
// Your IP address and port number. Default port number is
27960
set net_ip YOUR_IP_ADDRESS // get this by running "ipconfig"
set net_port 27960
// Important information about your server
set sv_hostname "Another WFA Beta Server - Beta v0-1"
set rconPassword "changeme" // Change this to your password of choice.
set sv_maxclients "16" // WFA maps are run optimally with 14 to 18 players.
// Optional information about your server
sets MOTD "Welcome to WFA -- www.captured.com/weaponsfactory"
sets Website "http://www.captured.com/weaponsfactory/quake3"
sets Location "Minneapolis, Minnesota"
sets Admin "admin@email.com"
sets Connection "T3"
// ********************************************
// You will probably not need to modify anything below this point
// ********************************************
// Maplist
// These are all of the Beta maps in a maplist fashion, change them
// to the order of your choice, however this part can remain untouched
// and still work with the original BETA maps.
set d1 "map 2fort2001-wfa ; set nextmap vstr d2"
set d2 "map Slab-wfa ; set nextmap vstr d3"
set d3 "map LanFear-wfa ; set nextmap vstr d4"
set d4 "map unfadable-wfa ; set nextmap vstr d5"
set d5 "map blade-wfa ; set nextmap vstr d6"
set d6 "map 2castles-wfa ; set nextmap vstr d7"
set d7 "map cruel-wfa ; set nextmap vstr d8"
set d8 "map Ease-wfa ; set nextmap vstr d9"
set d9 "map 3level1-wfa ; set nextmap vstr d10"
set d10 "map gensurf-wfa ; set nextmap vstr d11"
set d11 "map lavender-wfa ; set nextmap vstr d12"
set d12 "map grazer-wfa ; set nextmap vstr d13"
set d13 "map bulfort-wfa ; set nextmap vstr d14"
set d14 "map twf-wfa ; set nextmap vstr d1"
vstr d1
// Other important WFA configuration options.
// You will probably not need to change any of these.
seta sv_master1 "master3.idsoftware.com"
seta sv_master2 "master0.gamespy.com"
seta bot_enable "0"
seta sv_maxrate "15000"
seta g_friendlyfire "0"
seta timelimit "20"
seta capturelimit "16" // How many flag caps before map change
seta fraglimit "0" // Set this to 0 for WFA CTF play.
seta droppacks 1 // when a player dies they will drop a pack containing ammo.
seta sv_floodcontrol "0" // Set this to 0, prevents command floods
seta cvar_restart
seta sv_cheats 0
// eof
To download a sample wfa-server.cfg click here.
Step 3: Now you have to make a shell script to handle the starting of the server and the command lines that are needed to set variables for WFA. Below is what a typical shell script will look like, with an added feature of of making logs out of the "nohup.out" file before it overwrites it. This is useful for server admins to see what has happened on their server, or perhaps why it has crashed.
A shell script should begin with "#!/bin/sh" to tell linux that it can be executed I.E.. "./gowfa". Next I have added a line to rename the nohup.out's to a log file and move it into a directory named logs which you created earlier.
The next line should point to your quake 3 directory, again this is the default path. So if your quake 3 directory was /games/quake3/, you would make this line look like "cd /games/quake3/".
This line should be left alone, as long as you made a directory named "logs" in your quake3 directory.
Now the next line is really important. This is your command line to start the server. I use nohup for starting my server, so it wont end the process when i logout from my server, hence the name 'nohup' coined from "No Hangup".
The "\" after each line is to tell linux that the next line is a continuation of the previous, so it dosent try to take it as a new line of input. And finally the "&" at the very end is to tell linux to run this process in the background. Also running a process also takes its priority and sets it from 0 (default) to 5. The scale for priority goes from -20 to +20. -20 being idle and +20 being highest priority. You can up the process priority of your server by typing "ps -ef|grep q" This will tell you the Process Id Number (also know as PID) and you can then use the command "renice" to up the priority, I.E. "renice [PID] [new priority]" . I generally use 10 or so, which makes it a medium high priority on the CPU. althought 5 is generally good for most servers. Lastly, to terminate your server, you can either use RCON with the command "killserver" or from your shell, you can type "ps -ef|grep q" again and get the PID and and type "kill [PID]" and that will send a kill signal the the server prcoess. To start it again just type "./gowfa" in the directory with your shell script in it (it should reside in your WFA directory to make things simple). Another trick you can use is "tail" with the option -f in your quake3 directory. I.E. "tail -f nohup.out" and that will show you what the console is displaying, and the option -f will keep it in tail mode, so you can simply monitor your conslole with it.
#!/bin/sh
cd /usr/local/games/quake3
mv -bfVt nohup.out ./logs
nohup ./q3ded +set cvar_restart +set sv_pure 0 +set dedicated 2 \
+set fs_game WFA +set com_hunkmegs 64 +set g_gametype 4 \
+set net_ip 206.132.234.200 +set net_port 27960 \
+set g_fortassault 0 +set g_fortassaulttime 0 +exec wfa-server.cfg &
Click here to download a sample shell script.
Questions? Comments? E-Mail mojo@captured.com.
Click here to go home
All texts contained herein are copyright to Jason 'Mojo' Lindberg, and WFS. For permission to repost, reproduce, or print for publication, Email the author at mojo@captured.com.