Call of Duty 1 server on Linux
Call of Duty 1 server on Linux
In this guide, I will explain how to create a Call of Duty 1 server with CoDaM.
This guide assumes that you already have a basic understanding of the Linux shell, good general understanding and the following:
  - An installation of Call of Duty 1 or access to the .pk3 files.
- A direct internet connection on the host. See FAQ section on NAT/Forwarding for non-direct internet connections.
You can find all the necessary files needed to setup a server on 
this resource.
The 
# symbol will be used to illustrate a root shell command.
PREREQUISITES
First ensure you have the appropriate Linux libraries installed.
On Ubuntu/Debian and variants:
# apt-get install lib32z1 libc6-i386
On Arch Linux and variants:
# pacman -S lib32-glibc lib32-zlib
STEP 1
We will setup the Call of Duty server under the following path: 
/data/myserver.
If you don't have a 
/data folder, don't worry, we will create the path shortly.
Create a folder structure resulting in a path like 
/data/myserver/main. 
# mkdir -p /data/myserver/main
We will continue by creating an appropriate user for the Call of Duty server called 
codserver.
On Ubuntu/Debian variants you may need to change 
/usr/bin/nologin to 
/usr/sbin/nologin in the following command.
Use 
whereis nologin command to see the path to 
nologin. 
# useradd -r -s /usr/bin/nologin codserver
STEP 2
We will now copy the necessary server files over to our Call of Duty server directory.
Download the necessary 
1.1 basefiles and the Linux binaries 
cod-lnxded-1.1d.tar.bz2.
You can also browse the individual 1.1 
basefiles files.
Copy the following files to 
/data/myserver:
Copy the following files to 
/data/myserver/main.
  - game.mp.i386.so
- pak0.pk3
- pak1.pk3
- pak2.pk3
- pak3.pk3
- pak4.pk3
- pak5.pk3
- pak6.pk3
- localized_english_pak0.pk3
- localized_english_pak1.pk3
For server versions other than Call of Duty 1.1, you will need to add different and additional 
.pk3 files and different Linux binaries.
  -  Files for COD 1.5:
  
-  Files for COD:UO:
  
STEP 3
We will now create the main config file inside the 
main/ folder. We'll call this file 
myserver.cfg.
Copy and paste in the following to the 
myserver.cfg file and edit the required CVARs to your needs:
// Add server to xFire
set gamename "Call of Duty"
// Developer settings
set developer "0"
set developer_script "0" // printLn() print to console
// Server information (visible public/getstatus)
sets ^1Owner "<OWNER NAME>"
sets ^1Distro "Linux"
sets ^1Location "^2Germany (1000/1000mbit)"
// Server options
set sv_maxclients "16"
set sv_hostname "<SERVER NAME>"
set scr_motd "<WELCOME MESSAGE>"
set sv_pure "0"
set g_gametype "sd"
set rconpassword "<RCON PW HERE>"
set g_password "<JOIN PW HERE>"
set sv_privatepassword ""
set sv_privateclients "0"
set sv_allowdownload "0"
set sv_cheats "0"
set g_log "" // logPrint() logfile (default games_mp.log)
set g_logsync "0"
set logfile "0" // "1" output console to console_mp_server.log file
set sv_fps "20"
set sv_allowanonymous "0"
set sv_floodprotect "1"
set g_inactivity "0"
// Network options
set sv_maxrate "0"
set sv_maxping "0"
set sv_minping "0"
// Additional masterservers (up to sv_master5, sv_master1 default to Activision)
set sv_master2 "master.cod.pm"
// Game options (stock gametypes)
set g_allowvote "0"
set scr_allow_vote "0"
set scr_drawfriend "0"
set scr_forcerespawn "0"
set scr_friendlyfire "0"
// Deathmatch
set scr_dm_scorelimit "50"
set scr_dm_timelimit "30"
// Team Deathmatch
set scr_tdm_scorelimit "100"
set scr_tdm_timelimit "30"
// Behind Enemy Lines
set scr_bel_scorelimit "50"
set scr_bel_timelimit "30"
set scr_bel_alivepointtime "10"
// Retrieval
set scr_re_scorelimit "10"
set scr_re_timelimit "0"
set scr_re_graceperiod "15"
set scr_re_roundlength "2.50"
set scr_re_roundlimit "0"
set scr_re_showcarrier "0"
// Search and Destroy
set scr_sd_scorelimit "10"
set scr_sd_timelimit "0"
set scr_sd_graceperiod "20"
set scr_sd_roundlength "2.50"
set scr_sd_roundlimit "0"
// Weapons
set scr_allow_m1carbine "1"
set scr_allow_m1garand "1"
set scr_allow_enfield "1"
set scr_allow_bar "1"
set scr_allow_bren "1"
set scr_allow_mp40 "1"
set scr_allow_mp44 "1"
set scr_allow_sten "1"
set scr_allow_ppsh "1"
set scr_allow_fg42 "1"
set scr_allow_thompson "1"
set scr_allow_panzerfaust "1"
set scr_allow_springfield "1"
set scr_allow_kar98ksniper "1"
set scr_allow_nagantsniper "1"
set scr_allow_kar98k "1"
set scr_allow_nagant "1"
set scr_allow_mg42 "1" // CoDaM setting
// Execute CoDaM Configuration
exec CoDaM.cfg
exec CoDaM_HamGoodies.cfg
exec CoDaM_MiscMod.cfg
STEP 4
(This step is optional for those who wish to install CoDaM.)
Now, we are going to install CoDaM. Download the following CoDaM core files:
Extract the following files and folders to your 
main/ folder. 
From 
CoDaM_V1.31.zip file:
  - codam/
- CoDaM.cfg
- ___CoDaM__CoD1.1__.pk3
From 
CoDaM_HamGoodies_V1.35.zip file:
	- codam/
- CoDaM_HamGoodies.cfg
- ___CoDaM_HamGoodies__CoD1.1__.pk3
Now edit the following in 
modlist.gsc located inside the 
/data/myserver/codam folder. 
UNDER:
// Example from Hammer's Goodies -- REMOVE the // to activate
ADD:
[[ register ]]( "Hammer's Goodies", codam\HamGoodies::main );
Now edit the configuration (
.cfg) files to suit your needs, and you will have CoDaM installed on your server.
This guide does not explain how to configure the configuration files of CoDaM as they are already well documented inside the configuration files.
STEP 5
Now that the server is created and configured lets create the start script.
Enter the 
/data/myserver directory and create a file called 
startmyserver.sh then copy and paste in the following code section into the file:
#!/bin/sh
exec setpriv --reuid=codserver --regid=codserver --clear-groups sh -- <<- 'COD'
	HOME=/data/myserver
	exec env - LD_PRELOAD=$HOME/codextended.so $HOME/cod_lnxded +set fs_homepath $HOME +set fs_basepath $HOME +set net_ip <ipaddr> +set net_port 28960 +exec myserver.cfg +map mp_harbor < /dev/tty
COD
NOTE: You can't use a path with spaces using 
LD_PRELOAD. The above script does not support a path with spaces.
Edit the 
startmyserver.sh file to suit your configuration, notably the 
+set net_ip and 
+set net_port parts.
Ensure that the server has the appropriate permissions set for the 
codserver user we created earlier, by running the following commands:
# chown -R codserver:codserver /data/myserver
# find /data/myserver -type d -exec chmod 0770 {} \;
# find /data/myserver -type f -exec chmod 0660 {} \;
# chmod u+x /data/myserver/cod_lnxded /data/myserver/startmyserver.sh
You can now start the server with the following command:
# /data/myserver/startmyserver.sh
Press 
CTRL + C to stop the server or type 
quit in the server console.
You can if you prefer use the following command to run server in the background instead:
# nohup /data/myserver/startmyserver.sh >/dev/null 2>&1 &
To bring the server back to the foreground you can use the 
fg command.
The server will run on the host machine as the user 
codserver.
To keep running the gameserver persistently in the background; a terminal multiplexer such as 
tmux or 
screen can be used.
CoDExtended
(This section is optional for those who wish to install 
codextended.so.)
To enhance the server by using 
codextended.so, the 
.so library have to be downloaded (
repo|
releases) and added to the 
myserver/ folder.
The above mentioned start script already attempt to load 
codextended.so into 
cod_lnxded.
Ensure that the 
codextended.so file has the appropriate permission for the 
codserver user.
# chown codserver:codserver /data/myserver/codextended.so
# chmod 660 /data/myserver/codextended.so
You can add the following 
codextended.so CVARs into 
myserver.cfg (taken from THiNK forum):
set x_deadchat 0		// Make death-chat visible to alive players? 1= yes 0= no
set x_nameflood 0		// Allow Spamming Names? 1= Yes 0= No
set x_nopbots 1			// New bot movements (only takes effect if "scr_numbots" is enabled)
set x_spectator_noclip 0	// Allow spectator to fly through walls (noclip)? 1= Yes 0= No
set x_authorize 0		// 0= cracked server, 1 = non cracked server (cd key required)
set x_contents -1		// important - for collision of players - default = -1
TROUBLESHOOTING
Error 1
Sys_Error: Couldn't load default_mp.cfg.  Make sure Call of Duty is run from the correct folder.
Make sure you use the 
localized_english_pak0.pk3 and 
localized_english_pak1.pk3 files.
Error 2
-bash: /data/myserver/startmyserver.sh: /bin/sh^M: bad interpreter: No such file or directory
The file has DOS/Windows style line endings (CR LF), but on Unix-like systems only the LF control character is used as line break.
You can fix this by installing and running the 
dos2unix command on the file.
dos2unix /data/myserver/startmyserver.sh
A guide by Cato
Original URL: 
https://de.dvotx.org/dump/cod1/server_guide.linux.html
    
Author(s): Cato
Created on: 2021-08-26 15:46:11
Last update: 2025-06-28 15:32:33
        
        
Revision(s):
            2023-02-19 22:39:00 by Cato & Cheese: 
Updated startmyserver.sh and moved CVARs to myserver.cfg
            2024-06-06 18:00:32 by Cato: 
Removed defunct codmaster.comu-mvzg.com
            2024-09-22 18:06:51 by Raphael: 
Restructure myserver.cfg and remove unused CVARs