Insurgency

Insurgency

Not enough ratings
Setting up an Insurgency Dedicated Server in Linux - Start to Finish
By ToddTheRuse
This guide will describe how to set up a Linux dedicated server for the Insurgency Standalone.
   
Award
Favorite
Favorited
Unfavorite
Before you start.
This guide assumes that you have the following:
- You have already installed your CentOS 7 or Ubuntu 14 Operating system
- You have 10GB of free space (a 24GB hard disk should hold everything)
- You have forwarded the network port to the server

Notes:
- Unless otherwise specified, all steps apply to CentOS 7 and Ubuntu 14
- Things that start with the # sign are comments, bash wont execute them
- This guide will not work for CentOS 6 because of GLIBC issues
Step 1: Install SteamCMD
## Please run this as a user other than root.

## Packge Install CentOS 7:
yum -y install wget
yum -y install glibc.i686
yum -y install libgcc_s.so.1

## Package Install Ubuntu 14
sudo apt-get install wget
sudo apt-get install lib32gcc1

## Install SteamCMD Ubuntu 14 and Centos 7
wget -O ~/steamcmd_linux.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf /root/steamcmd_linux.tar.gz
mkdir /insurgency
~/steamcmd.sh +login anonymous +force_install_dir "/insurgency" +app_update 237410 +quit
Step 2: Open Ports on Server Firewall
## CentOS 7
firewall-cmd --zone=public --add-port=27015/tcp --permanent
firewall-cmd --zone=public --add-port=27015/udp --permanent
firewall-cmd --reload


## Ubuntu 14
## (not neccesary)
Step 3: Edit Your Server.cfg
cp /insurgency/insurgency/cfg/server.cfg.example /insurgency/insurgency/cfg/server.cfg
vi /insurgency/insurgency/cfg/server.cfg
# Please edit this file to change your RCON Password
Step 4: Create And Run Your Start Script
echo export LD_LIBRARY_PATH=/insurgency:/insurgency/bin > /insurgency/insurgency_start.sh
echo /insurgency/srcds_linux -console -port 27015 +map market_coop +maxplayers 8 >> /insurgency/insurgency_start.sh
sh /insurgency/insurgency_start.sh
Appendix
A good generic guide on how install Insurgency Server, which includes a good server.cfg example: https://developer.valvesoftware.com/wiki/Insurgency_2014_Dedicated_Server

If you have a windows server, Arc has an excellent guide: http://steamproxy.net/sharedfiles/filedetails/?id=345661185

I welcome any feedback on this guide. I hope this is helpful.
KVM install and Kickstart Script
For you techies out there. This can be used to automaticly install your server with no user input (just fill in ip addresses, passwords, etc below wherever I have ##). KVM is a very usefuly and free hypervisor and can allow you spin up virtual servers at home with ease. My main KVM server has httpd installed on is, hosting the kickstart files. This allows me to re-create my insurgency server from scratch with a single command.

----------------------------------- KVM VM Install Script -----------------------------------
virt-install \
--name=ins-dev \
--os-type=linux \
--os-varian=rhel7 \
--disk path=/var/lib/libvirt/images/ins-dev.img,size=24 \
--ram=2048 \
--vcpus=1 \
--network bridge:br0 \
--location http://mirror.centos.org/centos/7/os/x86_64/ \
--extra-args="ks=http://##my webserver#/ks/ins-dev.ks console=tty0 console=ttyS0,115200n8" \


----------------------------------- CentOS Kickstart Script -----------------------------------


# Language, Keyboard, and Time
lang en_US
keyboard us
timezone America/New_York --isUtc

# Users
rootpw ##encrypted pw### --iscrypted
user --name=user --password=##encrypted pw### --iscrypted

#platform x86, AMD64, or Intel EM64T
reboot
url --url=http://mirror.centos.org/centos/7/os/x86_64/

# Disks
bootloader --location=mbr
zerombr
clearpart --all --initlabel
autopart

# Network and Security
network --device=eth0 --bootproto=static --ip=##ip address## --netmask=##netmask## --gateway=##ip address## --nameserver=##ip address##,##ip address## --hostname=ins-dev.##my domain name##.net
auth --passalgo=sha512 --useshadow
selinux --enforcing
firewall --enabled --ssh
firewall --port 27015:tcp
firewall --port 27015:udp

# Do not run setup agent
firstboot --disable

# Install packages
skipx
%packages --nobase
@core --nodefaults
wget
yum-cron
%end

%post --interpreter /bin/bash --log /root/post.log
exec < /dev/console > /dev/console

# Enable auto-update
systemctl enable yum-cron.service
systemctl start yum-cron.service

# Run SteamCMD
wget -O /root/steamcmd_linux.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf /root/steamcmd_linux.tar.gz -C /root/
mkdir /ins2server
yum -y install glibc.i686
yum -y install libgcc_s.so.1
/root/steamcmd.sh +login anonymous +force_install_dir "/ins2server" +app_update 237410 +quit

# Create Insurgency Server start script
echo export LD_LIBRARY_PATH=/ins2server:/ins2server/bin > /ins2server/insurgency_start.sh
echo /ins2server/srcds_linux -console -port 27015 +map market_coop +maxplayers 64 >> /ins2server/insurgency_start.sh

# Create server.cfg
echo hostname "ToddTheRuse Dev Server" > /ins2server/insurgency/cfg/server.cfg
echo rcon_password "## my rcon password ##" >> /ins2server/insurgency/cfg/server.cfg
echo sv_pure "0" >> /ins2server/insurgency/cfg/server.cfg

# Set ownership to user
chown user -R /ins2server

%end
7 Comments
brutus 18 Nov, 2016 @ 12:54pm 
I wasn't aware it derrived from your kickstart script. That's one nice script you added. Very easy to use and commented :). I got similar scripts for Debian systems. Works like a charm. (just not game related)
ToddTheRuse  [author] 17 Nov, 2016 @ 4:33pm 
brutus. My guide it done this way because it is derived from my kickstart script. In case you are not aware, it is an automated installation method for RHEL type operating systems. Because the post installation section runs as root I wanted to put it in a folder owned by root, and then later create a user "user" and chmod to user. Its actually really handy. Ill post it in the article.
brutus 14 Nov, 2016 @ 7:44am 
You are aware this installs to /insurgency ? not really the right place for that. Personally, adding a user and putting the files in that users directory might work a bit better.
ToddTheRuse  [author] 2 Aug, 2016 @ 5:37pm 
You're welcome, glad it was helpful
David, your friend 31 Jul, 2016 @ 11:34pm 
10/10 - Simple, short, helpful. Thanks @author.
ToddTheRuse  [author] 9 Jun, 2016 @ 6:03pm 
@perheväkivalta: Nano is perfectly fine for editing, vi is just my choice and is in base build. YUM is also in base on CentOS/RHEL. I understand that DNF has some advantages but as an IT guy if something works I try not to install more than I have to.
Microwave On Wheels 9 Jun, 2016 @ 5:13pm 
Better to use dnf to install the plugins, plus nano to edit the documents if you're not a nerd