Medal of Honor: Spearhead Server Setup Guide

This guide walks you through setting up a Medal of Honor: Allied Assault Spearhead server on an Ubuntu Server. Follow the steps carefully to ensure a smooth setup. The guide supports version 2.15 only.

Requirements

  • Ubuntu Server
  • Local IP of the server (e.g., 192.168.0.123)
  • Access to your router to forward ports (default: 12203)

Optional: Create a User for the Server

We will use the username gameservers for this guide. You can change it to any name, but ensure consistency throughout.

Create the user:

sudo adduser --home /home/gameservers gameservers

Grant sudo access (optional):

sudo usermod -aG sudo gameservers

Switch to the user:

su - gameservers

Setting Up the Files

Create a new directory:

mkdir mohaash

Navigate to the directory:

cd mohaash

Download the minimalist server files from GitHub:

git clone https://github.com/Grimm1/main
git clone https://github.com/Grimm1/mainta

These are cut-down versions of the original game files, with all images and sound files replaced with placeholders.

Vanilla Server Setup

With the mohaash folder as your working directory, install required tools:

sudo apt-get install tmux

Download the server files:

wget grimms3dworlds.ddns.net/ul/shbins.tar.gz

Extract the files:

tar -xvf shbins.tar.gz

Remove the tar file:

rm shbins.tar.gz

This should result in the following file structure:

spearhead_lnxded
mainta/
    fgameded.so
    pak1.pk3
    pak2.pk3
    pak3.pk3
    pak4.pk3
    pak5.pk3

Make the main executable file executable:

sudo chmod +x spearhead_lnxded

The MOHAA Spearhead binaries are 32-bit, and modern Linux distributions may lack 32-bit support. Enable it with:

sudo dpkg --add-architecture i386

Update the package list:

sudo apt update

Install the required 32-bit dependencies:

sudo apt-get install libc6-i386 libstdc++5:i386

Note: The i386 architecture must be enabled for 32-bit support. If libstdc++5:i386 is unavailable, ensure your package sources are up-to-date or check for alternative 32-bit libraries.

Test the server installation:

./spearhead_lnxded

Once verified, press Ctrl+C to stop the server.

Server Configuration

Create a configuration file named server.cfg in the mainta folder. Use a text editor (e.g., nano or vim) to create and edit the file:

nano /home/gameservers/mohaash/mainta/server.cfg

Paste the following configuration into server.cfg. Adjust settings like sv_hostname, g_gametype, and map rotation as needed. For security, set rconpassword in the server start command instead of this file.


// Medal of Honor: Allied Assault Spearhead Server Configuration
// Place in the 'mainta' folder of your MOHAA server directory

// === General Server Settings ===
sv_hostname "Nameless Battle"          // Server name displayed in server browser
set sv_maxclients 24                   // Maximum number of players
set sv_privateclients 0                // Number of password-protected slots
set sv_privatepassword ""              // Password for private slots (leave empty if unused)
set sv_keywords ""                     // Keywords for server browser filtering
set sv_minping 0                       // Minimum ping allowed (0 = no limit)
set sv_maxping 0                       // Maximum ping allowed (0 = no limit)
set sv_maxrate 0                       // Maximum data rate per client (0 = no limit)
// set rconpassword "mystrongpassword"  // Set via command line for security, e.g., +set rconpassword mystrongpassword

// === Game Rules ===
set g_gametype 1                       // Game type: 1=FFA, 2=Team, 3=Round-Based, 4=Objective, 5=Tug of War
set g_healthdrop 1                     // Enable health packs drop on kill
set g_realismmode 1                    // Enable realistic mode
set g_teamdamage 0                     // Disable friendly fire
set g_healrate 10                      // Health pickup healing rate
set sv_dmspeedmult 1.100000            // Player run speed multiplier (1.0 = default)
set sv_invulnerabletime 3              // Seconds of invulnerability after spawn
set g_teamkillwarn 3                   // Team kills before warning
set g_teamkillkick 5                   // Team kills before kick
set g_teamswitchdelay 15               // Seconds before switching teams again

// === Time and Scoring ===
set timelimit 15                       // Match time limit (minutes)
set fraglimit 0                        // Score limit (0 = no limit)
set maprotationtime 0                  // Max time per map (0 = no limit)
set roundlimit 0                       // Round time limit (0 = no limit)
set sv_team_spawn_interval 0           // Delay between team spawns (seconds)

// === Player Management ===
set g_inactivespectate 60              // Seconds before inactive player becomes spectator
set g_inactivekick 900                 // Seconds before inactive player is kicked
set g_allowvote 1                      // Enable player voting
set g_forceteamspectate 1              // Force spectators to team mode
set g_forceready 0                     // Force match to start when ready
set g_forcespawn 0                     // Force immediate respawn
set g_allowjointime 30                 // Time players can join (seconds)

// === Server Features ===
set sv_gamespy 1                       // Enable GameSpy for server listing
set sv_pure 0                          // Disable file verification (0 = off)
set sv_floodprotect 1                  // Limit chat spam
set dmflags 0                          // Additional gameplay flags
set sv_gravity 800.000000              // Gravity value

// === Map Settings ===
set map "DM/mohdm6"                    // Starting map
set sv_maplist "dm/mp_bahnhof_dm dm/mp_brest_dm dm/mp_holland_dm dm/mp_malta_dm dm/mp_bazaar_dm dm/mp_gewitter_dm dm/mp_stadt_dm dm/mp_verschneit_dm dm/mp_unterseite_dm obj/mp_ardennes_tow obj/mp_berlin_tow obj/mp_flughafen_tow obj/mp_druckkammern_tow "                      // Map rotation list (e.g., "DM/mohdm1 DM/mohdm2")

Save the file and exit the editor (e.g., Ctrl+O, Enter, Ctrl+X in nano).

Note: Customize sv_hostname, map settings, and other parameters to suit your server. Avoid setting rconpassword in this file for security; include it in the server start command (e.g., +set rconpassword mystrongpassword).

Running the Server

Start the server with the following command:

./spearhead_lnxded +set dedicated 1 +set sv_maxclients 24 +set net_ip 192.168.0.123 +set net_port 12203 +set rconpassword mystrongpassword +exec server.cfg

Command Parameters:

  • sv_maxclients: Sets the maximum number of players.
  • net_ip: The local IP of the server (e.g., 192.168.0.123).
  • net_port: The port for the server (default: 12203; use different ports for multiple servers).
  • rconpassword: Sets the RCON password for remote administration.
  • +exec server.cfg: Specifies the configuration file to use.

Port Forwarding: Forward the server port (e.g., 12203) and the query port (12300 for the first server, 12301 for the second, etc.) on your router to the server’s local IP (e.g., 192.168.0.123). The query port is used for server browsers like GameSpy. Example for multiple servers:

Server Port Query Port
12204 12300
12206 12301
12222 12302

Security Tip: Use a firewall (e.g., ufw) to allow only necessary ports (12203, 12300) and set a strong rconpassword to protect your server.

Running as a Service

To run the server as a service in a tmux session, create the following systemd service files.

Master TMUX Service

Create /etc/systemd/system/master.service with:

[Unit]
Description=tmux master service
Wants=network-online.target
[Service]
Type=forking
User=gameservers
ExecStart=/usr/bin/tmux new-session -s master -d
ExecStop=/usr/bin/tmux kill-session -t master
[Install]
WantedBy=multi-user.target

MOHAA Spearhead Server Service

Create /etc/systemd/system/mohshserver.service ( Remember to change necessary values like net_ip and net_port) with:

[Unit]
Description=TMUX MOHAA Spearhead Server
PartOf=master.service
After=master.service
[Service]
Type=forking
User=gameservers
ExecStart=/usr/bin/tmux new-session -s mohshserver -d 'cd /home/gameservers/mohaash && ./spearhead_lnxded +set dedicated 1 +set sv_maxclients 24 +set net_ip 192.168.0.123 +set net_port 12203 +exec server.cfg'
ExecStop=/usr/bin/tmux kill-session -t mohshserver
Restart=always
RestartSec=5
WorkingDirectory=/home/gameservers/mohaash
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

IF you want to run multiple servers change the instances of mohshserver in the above to mohshsserver2 for example!

Reload the systemd daemon:

sudo systemctl daemon-reload

Enable the master service:

sudo systemctl enable master.service

Enable the mohshserver service:

sudo systemctl enable mohshserver.service

Start the master service:

sudo systemctl start master.service

Start the mohshserver service:

sudo systemctl start mohshserver.service

Check the service status:

sudo systemctl status mohshserver.service

Access the tmux session:

tmux attach-session -t mohshserver

Note: The server will now run as a background service and automatically restart if it crashes. Use tmux to monitor or manage the session.

Bottom Left BackgroundBottom Right Background
Grimms 3D worlds
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.