[Tut] Installing a Dedicated Server on Linux
- Ответы 127
- Просмотры 11,7k
- Created
- Последний ответ
Top Posters In This Topic
-
Woofy 40 posts
-
Fatalxeno 7 posts
-
stephen92 6 posts
-
HayleyWilliams 5 posts
Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
Setting up an IW4M dedicated server on Linux
Requirements: Basic Linux command line knowledge.
Some of the commands below will only work on Debian based distributions (Debain, Ubuntu, ...). If you're using something else, you'll most likely run into problems installing the packages (e.g. you have to use yum instead of apt-get on RHEL/CentOS) and compiling wine. Please use google to find out how to do so on other distributions.
//Update Jul 19: Got rid of Xvfb, added tutorial on how to compile wine.
//Update Jan 2: Added CentOS/Fedora/RHEL instructions (thanks to mission)
When you see a list like this, execute each line consecutively through the shell:
command 1
command 2
command 3
But now let's get started:
1. Installing necessary packages
Login as root. Install the following packages:
Debian, Ubuntu etc.:
apt-get install unzip mono-complete wget nano tar bzip2 make
Fedora, CentOS, RHEL (?):
yum install unzip mono-core wget nano
2. Installing wine
If you already have at least version 1.4 of wine installed, skip this step.
Use
wine --version
to determine your version of wine. If you have a version older than 1.4 installed, remove it.
Debian, Ubuntu etc.:
Download the latest version of wine from http://sourceforge.net/projects/wine/files/Source/ and extract it to /usr/src. As I write this, it's wine-1.5.9:
-
http://sourceforge.net/projects/wine/files/Source/wine-1.5.9.tar.bz2/downloadcd /usr/src
wget -O wine-1.5.9.tar.bz2
tar xvf wine-1.5.9.tar.bz2
rm wine-1.5.9.tar.bz2
Install the building dependencies of wine:
apt-get build-dep wine
Compile and install wine. This will take quite a while.
cd /usr/src/wine-1.5.9
./configure
make && make install
Note that you need to adjust the commands to whatever version you downloaded!
Fedora, CentOS, RHEL (?):
-
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmwget
rpm -Uvh epel-release-6*.rpm
yum --enablerepo=epel install wine
3. Creating a new user account
Don't use your root account to run a server. Instead, create a new one, e.g.
and log in with it.
4. Getting the game files
Create a new folder for your gameserver files. I chose
mkdir ~/iw4m/
Upload the following files from your local MW2 installation into your newly created folder:
binkw32.dll
mss32.dll
localization.txt
main\iw_00.iwd
zone\dlc\* (all files)
zone\english\*mp*.ff (every file that has "mp" somewhere in it's name)
zone\english\contingency.ff
zone\english\gulag.ff
zone\english\oilrig.ff
(Note that instead of 'english' the folders' name will be the language of your game installation).
Your gameserver folder should look like this now:
5. Getting the server files
CD to your gameserver folder. Download the dedicated server update tool and run it. Rename iw4m.dat to iw4m.exe.
-
http://fourdeltaone.net/iw4m/dsut.zipcd ~/iw4m/
wget
unzip dsut.zip
rm dsut.zip
mono iw4m_updater.exe
mv iw4m.dat iw4m.exe
6. Creating a config file
Create a folder called 'players'. Download the preconfigured server.cfg and customize it as desired.
-
http://pastebin.com/download.php?i=5wSjHTQTmkdir players
cd players
wget -O server.cfg
nano server.cfg
7. Port forwarding
Pick a port you want to run the server on and forward it in your firewall (TCP and UDP). I chose 28960 (standard).
8. Running the server
Start your server without the -console parameter using wine, for example:
cd ~/iw4m/
wine iw4m.exe -dedicated +set net_port 28960 +set party_maxplayers 18 +exec server.cfg +map_rotate &
Stop your server by killing iw4m.exe:
killall -9 iw4m.exe
You can download the following scripts to manage your server easily:
-
http://pastebin.com/download.php?i=Nd8khDRUcd ~/iw4m/
wget -O start.sh
wget -O stop.sh http://pastebin.com/download.php?i=5E43ZKq4
chmod +x start.sh stop.sh
This will start your server with 18 slots on port 28960 in the background. It will also execute your server.cfg. Edit start.sh to change the parameters.
And that's it! Run start.sh to start your server and stop.sh to stop it:
cd ~/iw4m/
./start.sh
./stop.sh
Check whether your server is running via
ps -ef | grep iw4m.exe
You might see errors when starting the server. Before asking, please check if the server is running correctly despite those errors.
Updating the server
Stop your server and run the updater.
cd ~/iw4m/
./stop.sh
mono iw4m_updater.exe