Running on linux

From GTA Network Wiki
Jump to: navigation, search

Running on linux

Introduction

This short tutorial will show you how to run a GTA Network server on Linux distributions.

By default, GTA Network makes use of port 4499 UDP for server access so make sure that it is unblocked before starting your server

Installing mono

Debian, Ubuntu, and derivatives

Latest Debian/Ubuntu releases

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update && sudo apt-get install mono-complete

Outdated Ubuntu releases (Ubuntu 12.04/12.10)

echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

CentOS 7, Fedora 19 (and later), and derivatives

# Run all these commands in a root shell, or as an alternative, you can use sudo
yum install yum-utils
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
yum update && yum install mono-complete

Other distributions

Please refer to the official mono documentation

Setting up the server

Debian, Ubuntu, and derivatives

# ~/server = /root/server/
sudo apt-get install unzip
cd /tmp
wget https://gtanet.work/files/server/latest.zip
unzip latest.zip -d ~/server
cd ~/server
chmod +x GTANetworkServer.exe
mono GTANetworkServer.exe

# Firewall commands (iptables only) (dont forget to save the rule after adding it)
iptables -A INPUT -p udp --dport 4499 -j ACCEPT

CentOS 7, Fedora 19 (and later), and derivatives

# ~/server = /root/server/
sudo yum install unzip
cd /tmp
wget https://gtanet.work/files/server/latest.zip
sudo unzip latest.zip -d ~/server
cd ~/server 
chmod +x GTANetworkServer.exe
mono GTANetworkServer.exe

# Firewall commands (iptables only) (dont forget to save the rule after adding it)
iptables -A INPUT -p udp --dport 4499 -j ACCEPT

Using screen for running server in background

Setting up

Debian, Ubuntu and derivatives

sudo apt-get install screen

CentOS 6.x/7.x

yum install screen

Starting the server

screen -dmS GTANETWORKSERVER -L bash -c 'cd ~/server && mono GTANetworkServer.exe'

# Parameter explanation
# screen -dmS = starts a separate shell without directly opening an interface towards it (detached mode). The S param defines a session name for the newly created session, so that it is easier to manage in the future.
# screen -L = basically logs whatever error that is shown by the server through the separate shell into a file for easier reference in the future.
# !IMPORTANT!
# Log output will be saved as screenlog._number_ in the server directory.

Stopping the server

screen -S GTANETWORKSERVER -X quit

# Parameter explanation
# screen -S = attaches to an already defined session name that is running
# screen -X = sends a command directly to the attached session 

Troubleshooting

  • System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.)

First, Make sure that the masterserver line looks exactly like this: <masterserver>http://master.gtanet.work</masterserver>

If that does not solve it, make sure ca-certificates-mono is installed.

Other possible fixes: mozroots --import --ask-remove


  • System.NotImplementedException: The request feature is not implemented (LinuxUnicastIPAddress error)

Make sure you are not running a old mono version mono -V, anything above 4.5.2 should work fine.


  • Missing method .ctor in assembly (example) or any kind of unimplemented feature error

Make sure you are not running an outdated mono version.

At the time of this writing, the current stable mono version available is 4.6.1 and is confirmed to be working perfectly fine.

To check the currently installed mono version: mono -V