Topic: Dedicated Linux Server Tutorial

First, download the required files:

wget ftp://largedownloads.ea.com/pub/patches/BF2142/1.50/bf2142-linuxded-1.10.48.0-installer.zip
wget http://www.woodat.com/firststrike_v1.30_serverfiles.rar
wget http://www.woodat.com/builds/firststrikeserver1.4updater_linux.zip

Next, unzip the 2142 server installer with:

unzip bf2142-linuded-1.10-48.0-installer.zip

Now, run the 2142 server installer.

sh bf2142-linuxded-1.10.48.0-installer.sh

Your server files will now begin to install, and you'll be prompted to agree to the EA and PB EULA.  After these two prompts, you will be asked for the directory you wants to install your server to.  You may install it wherever you please.  For the sake of this guide, we will use "/home/bf2142server".

So, now you have the 2142 server installed, it's time to install First Strike to it, the first step is to extract the 1.3 server files to the mods folder.  To do this, type the following command (assuming you installed to "/home/bf2142server", replace with your actual path)

unrar x firststrike_v1.30_serverfiles.rar /home/bf2142server/bf2142/mods

Now, we'll extract the server updater with the following command

unzip firststrikeserver1.4updater_linux.zip -d /home/bf2142server

Now, we can boot up our server for a test run and first update.  To do this, run the following command

python /home/bf2142server/bf2142/FirstStrikeServer.py

Once this starts up, your server will begin to update to the latest version of First Strike before launching.  This may take a few moments on the first go, so be patient.  While running, your server will periodically check to see if a new version has been released and keep your server up to date.  It will only update if your server is unoccupied, so don't worry about it emptying out your populated server.

Once the update is done, your server should begin to load up on the default maplist and configurations.  Likely these settings aren't right for you, and will need some tweaking, so go ahead and kill the server (CTRL + C Twice, once for the main server and once for the Updater) Now, we can begine editing the server settings.

Using your favorite editor, the first file you'll want to edit is the serversettings.con:

mcedit bf2142/mods/firststrike/settings/serversettings.con

Note: You can also use joe, emacs, vi(m) or nano instead of mcedit. Any editor you feel comfortable with.

It's very important that you change sv.internet to 1, sv.serverIP to your server's IP and sv.interfaceIP to your server's IP as well or it will not be visible online.  You'll also probably want to change a few other settings to fit your needs, such as sv.ServerName, but these are self explanatory.  Once you're finished, save serversettings.con and close the editor.

You can also edit the maplist.con in the same way to change what maps are in your rotation.

Once these files are edited, you're ready to start up your server for regular use.  To do so, simply type the following command

python /home/bf2142server/bf2142/FirstStrikeServer.py

Your server should now be up and running and read to join.  If the server should crash, it will be started back up automatically.  However, if you wish to start your server on boot, you will have to configure this yourself.  The following will setup your server to start on boot on a debian-based distro:

add a short script in /etc/init.d
called _gameserver.sh which puts your server in an accessible screen session on each boot.
You can then view your server session using screen -r bf2142_fs but you have to install the screen utility first.
Anyway, let's add the start-up script.
mcedit /etc/init.d/_gameserver.sh
with these contents:

#!/bin/sh
# Start gameservers on boot-up

case "$1" in
'start')
    screen -dmS bf2142_fs python /home/bf2142server/bf2142/FirstStrikeServer.py 
    ;;
'stop')
    ;;
*)
    echo "Usage: $0 { start | stop }"
    ;;
esac
exit 0
Note: This is for Debian-based Distros only! I don't know where other distros have their start-up scripts.

Thanks goes to Svenstaro for pieces of this tutorial.  If you have any problems let me know.  Info on adding 2142cc support will be added in the near future.

http://www.dsgaming.net/imperial/fssig.jpg
http://miniprofile.xfire.com/bg/co/type/2/dsimperial.png
http://stats.fsmod.com/sig/trooper.Imperial.png